/[ascend]/trunk/tcltk98/generic/interface/typelex.l
ViewVC logotype

Diff of /trunk/tcltk98/generic/interface/typelex.l

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 389 by johnpye, Thu Mar 30 04:46:48 2006 UTC revision 390 by johnpye, Thu Mar 30 06:41:17 2006 UTC
# Line 46  Line 46 
46   *   *
47   */   */
48    
49  #include "tcl.h"  #define MY_YYMORE() yymore()
50  #include "utilities/ascConfig.h"  
51  #include "general/list.h"  #include <tcl.h>
52    #include <utilities/ascConfig.h>
53    #include <general/list.h>
54  #ifndef TYPER_TEST  #ifndef TYPER_TEST
55  /* for handling string modules and results in interp */  /* for handling string modules and results in interp */
56  #include "compiler/compiler.h"  #include <compiler/compiler.h>
57  #include "compiler/symtab.h"  #include <compiler/symtab.h>
58  #include "compiler/fractions.h"  #include <compiler/fractions.h>
59  #include "compiler/dimen.h"  #include <compiler/dimen.h>
60  #include "compiler/child.h"  #include <compiler/child.h>
61  #include "compiler/type_desc.h"  #include <compiler/type_desc.h>
62  #include "compiler/library.h"  #include <compiler/library.h>
63  #include "compiler/module.h"  #include <compiler/module.h>
64  #include "interface/HelpProc.h" /* help is not necessary for test */  #include "HelpProc.h" /* help is not necessary for test */
65  #endif /*!typertest*/  #endif /*!typertest*/
66  #include "interface/typelex.h"  
67    #include "typelex.h"
68    
69    
70  #ifndef lint  #ifndef lint
71  static const char TyperID[] = "$Id: typelex.l,v 1.20 2003/08/23 18:43:09 ballan Exp $";  static const char TyperID[] = "$Id: typelex.l,v 1.20 2003/08/23 18:43:09 ballan Exp $";
72  #endif  #endif
73    
74  #define ZZ_BREAK  #define YY_BREAK
75  /*  /*
76   *  Defining zzbreak as above (empty) means that all of our matches must end   *  Defining yybreak as above (empty) means that all of our matches must end
77   *  in break or return because the normal flex supplied zzbreak will   *  in break or return because the normal flex supplied yybreak will
78   *  be preempted by our empty one.   *  be preempted by our empty one.
79   *  In cases where matches contain a conditional return, make sure a   *  In cases where matches contain a conditional return, make sure a
80   *  break follows in the failure case.   *  break follows in the failure case.
# Line 111  static int ShowComments = 0; Line 114  static int ShowComments = 0;
114  static unsigned long StartId = 0;  static unsigned long StartId = 0;
115  /*  /*
116   *  The location in the `zztext' array where the MODEL, ATOM, or CONSTANT   *  The location in the `zztext' array where the MODEL, ATOM, or CONSTANT
117   *  identifierbegins.  We save this value and call zzmore() when we find   *  identifierbegins.  We save this value and call MY_YYMORE() when we find
118   *  a MODEL, ATOM, or CONSTANT keyword; StartId tells us where the   *  a MODEL, ATOM, or CONSTANT keyword; StartId tells us where the
119   *  Identifier will go.   *  Identifier will go.
120   */   */
# Line 469  constant   CONSTANT{ws}+ Line 472  constant   CONSTANT{ws}+
472       *  Once we've found the start of the matching MODEL, ATOM, or       *  Once we've found the start of the matching MODEL, ATOM, or
473           *  DEFINITION, print the text until we find the END token.           *  DEFINITION, print the text until we find the END token.
474           *  When we find END, save the current length of zztext and use           *  When we find END, save the current length of zztext and use
475           *  zzmore() to append the identifier, then check the identifier           *  MY_YYMORE() to append the identifier, then check the identifier
476           *  (in the CheckID state) to see if it is what we want.  If so,           *  (in the CheckID state) to see if it is what we want.  If so,
477       *  this is the end of this MODEL, ATOM, or DEFINITION.       *  this is the end of this MODEL, ATOM, or DEFINITION.
478       */       */
# Line 484  constant   CONSTANT{ws}+ Line 487  constant   CONSTANT{ws}+
487                    StartId = zzleng;                    StartId = zzleng;
488                                    MatchedToken = MODEL_END;                                    MatchedToken = MODEL_END;
489                    BEGIN(CheckID);                    BEGIN(CheckID);
490                    zzmore();                    MY_YYMORE();
491                    break;                    break;
492                  }                  }
493  <Model>[^({A-Z]+        |  <Model>[^({A-Z]+        |
# Line 538  constant   CONSTANT{ws}+ Line 541  constant   CONSTANT{ws}+
541      /*      /*
542       *  Code to look for [UNIVERSAL ]{MODEL|ATOM|CONSTANT|DEFINITION}.       *  Code to look for [UNIVERSAL ]{MODEL|ATOM|CONSTANT|DEFINITION}.
543       *       *
544       *  If we find UNIVERSAL, use zzmore() to append the next       *  If we find UNIVERSAL, use yymore() to append the next
545       *  keyword---probably MODEL, ATOM, or CONSTANT.       *  keyword---probably MODEL, ATOM, or CONSTANT.
546       *  If we find MODEL, ATOM, CONSTANT, or DEFINITION save the       *  If we find MODEL, ATOM, CONSTANT, or DEFINITION save the
547       *  current length and use zzmore() to append the identifier,       *  current length and use yymore() to append the identifier,
548       *  then check the identifier (in the CheckID state) to see if       *  then check the identifier (in the CheckID state) to see if
549       *  it is what we're looking for.       *  it is what we're looking for.
550       */       */
# Line 552  constant   CONSTANT{ws}+ Line 555  constant   CONSTANT{ws}+
555                     *  the following ATOM/MODEL/CONSTANT                     *  the following ATOM/MODEL/CONSTANT
556                     *  keyword.                     *  keyword.
557                     */                     */
558                    zzmore();                    MY_YYMORE();
559                    break;                    break;
560                  }                  }
561  <INITIAL>{model}        |  <INITIAL>{model}        |
# Line 569  constant   CONSTANT{ws}+ Line 572  constant   CONSTANT{ws}+
572                    StartId = zzleng;                    StartId = zzleng;
573                    MatchedToken = MODEL;                    MatchedToken = MODEL;
574                    BEGIN(CheckID);                    BEGIN(CheckID);
575                    zzmore();                    MY_YYMORE();
576                    break;                    break;
577                  }                  }
578  <INITIAL>{constant}     {  <INITIAL>{constant}     {
# Line 583  constant   CONSTANT{ws}+ Line 586  constant   CONSTANT{ws}+
586                    StartId = zzleng;                    StartId = zzleng;
587                    MatchedToken = CONSTANT;                    MatchedToken = CONSTANT;
588                    BEGIN(CheckID);                    BEGIN(CheckID);
589                    zzmore();                    MY_YYMORE();
590                    break;                    break;
591                  }                  }
592    

Legend:
Removed from v.389  
changed lines
  Added in v.390

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22