gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] GM2 Bug


From: Iztok Kobal
Subject: [Gm2] GM2 Bug
Date: Sun, 17 Oct 2004 17:13:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2

GM2 - latest CVS

#>gm2 -c -Wiso -save-temps -g3 -O3 -gstabs+ -I. LongConv.mod
LongConv.mod:1: internal compiler error: in layout_type, at stor-layout.c:1558
Please report this crash to the GNU Modula-2 mailing list <address@hidden>

DEFINITION MODULE ConvTypes;

  (* Common types used in the string conversion modules *)

TYPE
  ConvResults = (* Values of this type are used to express format of a string *)
  (
    strAllRight,   (* string format is correct for the corresponding conversion 
*)
    strOutOfRange, (* string is well-formed but the value cannot be represented 
*)
    strWrongFormat,(* the string is in the wrong format for the conversion *)
    strEmpty       (* the given string is empty *)
  );

  ScanClass =  (* Values of this type are used to classify input to finite
                  state scanners *)
  (
    padding,    (* a leading or padding character at this point in the scan
                   - ignore it *)
    valid,      (* a valid character at this point in the scan - accept it *)
    invalid,    (* an invalid character at this point in the scan - reject it *)
    terminator  (* a terminating character at this point in the scan 
                   (not part of token) *)
  );

  ScanState =  (* The type of lexical scanning control procedures *)
    PROCEDURE (CHAR, VAR ScanClass, VAR ScanState);

END ConvTypes.
DEFINITION MODULE LongConv;

  (* Low-level LONGREAL/string conversions *)

IMPORT
  ConvTypes, RealConv;

TYPE
  ConvResults = ConvTypes.ConvResults;
                (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)


(****************************************************************)
(*                                                              *)
(*      GPM defines LONGREAL as a type alias of REAL so no      *)
(*      seperate implementation is required.  LongConv is       *)
(*      implemented by RealConv.                                *)
(*                                                              *)
(****************************************************************)

CONST
  ScanReal         = RealConv.ScanReal;
  FormatReal       = RealConv.FormatReal;
  ValueReal        = RealConv.ValueReal;
  LengthFloatReal  = RealConv.LengthFloatReal;
  LengthEngReal    = RealConv.LengthEngReal;
  LengthFixedReal  = RealConv.LengthFixedReal;
  IsRConvException = RealConv.IsRConvException;

END LongConv.
(* ---------------------------------------------------------------------
 * This program is copyright (c) 1996 Faculty of Information Technology,
 *  Queensland University of Technology, Brisbane, Australia.
 *  The program may be freely distributed in source or compiled form,
 *  provided this copyright notice remains intact in the sources.
 * --------------------------------------------------------------------- *)

(****************************************************************
$Log: LongConv.mod,v $
Revision 1.1.1.1  2004/10/06 05:46:24  iztok
Gardens Point Modula-2 ISO libs directory

Revision 1.1  2003/11/04 21:34:13  iztokk
added library sources and some document stuff

Revision 1.1  1996/09/06 07:51:17  lederman
Initial revision

*)

IMPLEMENTATION MODULE LongConv;

(****************************************************************)
(*                                                              *)
(*             NO SEPARATE IMPLEMENTATION REQUIRED              *)
(*                                                              *)
(*      GPM defines LONGREAL as a type alias of REAL so no      *)
(*      seperate implementation is required.  LongConv is       *)
(*      implemented by RealConv.                                *)
(*                                                              *)
(****************************************************************)

END LongConv.
DEFINITION MODULE RealConv;

  (* Low-level REAL/string conversions *)

IMPORT
  ConvTypes;

TYPE
  ConvResults = ConvTypes.ConvResults;
                (* strAllRight, strOutOfRange, strWrongFormat, strEmpty *)

PROCEDURE ScanReal (inputCh: CHAR; VAR chClass: ConvTypes.ScanClass;
                    VAR nextState: ConvTypes.ScanState);
(*
 * Represents the start state of a finite state scanner for real numbers - 
assigns
 * class of inputCh to chClass and a procedure representing the next state to
 * nextState.
 *)

PROCEDURE FormatReal (str: ARRAY OF CHAR): ConvResults;
(*
 * Returns the format of the string value for conversion to REAL.
 *)

PROCEDURE ValueReal (str: ARRAY OF CHAR): REAL;
(*
 * Returns the value corresponding to the real number string value str if str is
 * well-formed; otherwise raises the RealConv exception.
 *)

PROCEDURE LengthFloatReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
(*
 * Returns the number of characters in the floating-point string representation 
of
 * real with sigFigs significant figures.
 *)

PROCEDURE LengthEngReal (real: REAL; sigFigs: CARDINAL): CARDINAL;
(*
 * Returns the number of characters in the floating-point engineering string
 * representation of real with sigFigs significant figures.
 *)

PROCEDURE LengthFixedReal (real: REAL; place: INTEGER): CARDINAL;
(*
 * Returns the number of characters in the fixed-point string representation of 
real
 * rounded to the given place relative to the decimal point.
 *)

PROCEDURE IsRConvException (): BOOLEAN;
(*
 * Returns TRUE if the current coroutine is in the exceptional execution state
 * because of the raising of an exception in a routine from this module;
 * otherwise returns FALSE.
 *)

END RealConv.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]