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. |
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 |
*/ |
*/ |
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 |
*/ |
*/ |
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]+ | |
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 |
*/ |
*/ |
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} | |
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} { |
586 |
StartId = zzleng; |
StartId = zzleng; |
587 |
MatchedToken = CONSTANT; |
MatchedToken = CONSTANT; |
588 |
BEGIN(CheckID); |
BEGIN(CheckID); |
589 |
zzmore(); |
MY_YYMORE(); |
590 |
break; |
break; |
591 |
} |
} |
592 |
|
|