7 //fprintf(stderr,"\n-=<{oo}>=- %s\n",yytext)
9 /* ###--------------------------------------------------------------### */
10 /* function : search */
11 /* description : check that an identifier is a reserved word or not */
12 /* called func. : addht, addhtitem, gethtitem, namealloc */
13 /* ###--------------------------------------------------------------### */
17 static char *stripquotes();
19 static int search (key)
22 static ht *pt_hash = NULL;
24 if (pt_hash == NULL) {
25 pt_hash = addht (100);
26 addhtitem (pt_hash, namealloc("begin"), _BEGIN);
27 addhtitem (pt_hash, namealloc("clock"), _CLOCK);
28 addhtitem (pt_hash, namealloc("connectors"), _CONNECTORS);
29 addhtitem (pt_hash, namealloc("groups"), _GROUPS);
30 addhtitem (pt_hash, namealloc("asynchronous"), _ASYNCHRONOUS);
31 addhtitem (pt_hash, namealloc("equivalent"), _EQUIVALENT);
32 addhtitem (pt_hash, namealloc("disable"), _DISABLE);
33 addhtitem (pt_hash, namealloc("stable"), _STABLE);
34 addhtitem (pt_hash, namealloc("down"), _DOWN);
35 addhtitem (pt_hash, namealloc("default"), _DEFAULT);
36 addhtitem (pt_hash, namealloc("end"), _END);
37 addhtitem (pt_hash, namealloc("holdtime"), _HOLDTIME);
38 addhtitem (pt_hash, namealloc("input"), _INPUT);
39 addhtitem (pt_hash, namealloc("name"), _NAME);
40 addhtitem (pt_hash, namealloc("stability"), _STABILITY);
41 addhtitem (pt_hash, namealloc("output"), _OUTPUT);
42 addhtitem (pt_hash, namealloc("period"), _PERIOD);
43 addhtitem (pt_hash, namealloc("setuptime"), _SETUPTIME);
44 addhtitem (pt_hash, namealloc("version"), _VERSION);
45 addhtitem (pt_hash, namealloc("unstable"), _UNSTABLE);
46 addhtitem (pt_hash, namealloc("verify"), _VERIFY);
47 addhtitem (pt_hash, namealloc("specify"), _SPECIFY);
48 addhtitem (pt_hash, namealloc("up"), _UP);
49 addhtitem (pt_hash, namealloc("down"), _DOWN);
50 addhtitem (pt_hash, namealloc("noverif"), _NOVERIF);
51 addhtitem (pt_hash, namealloc("rising"), _RISING);
52 addhtitem (pt_hash, namealloc("falling"), _FALLING);
53 addhtitem (pt_hash, namealloc("from"), _FROM);
54 addhtitem (pt_hash, namealloc("for"), _FOR);
55 addhtitem (pt_hash, namealloc("to"), _TO);
56 addhtitem (pt_hash, namealloc("internal"), _INTERNAL);
57 addhtitem (pt_hash, namealloc("nodes"), _NODES);
58 addhtitem (pt_hash, namealloc("after"), _AFTER);
59 addhtitem (pt_hash, namealloc("before"), _BEFORE);
60 addhtitem (pt_hash, namealloc("conditioned"), _CONDITIONED);
61 addhtitem (pt_hash, namealloc("command"), _COMMAND);
62 addhtitem (pt_hash, namealloc("states"), _STATES);
63 addhtitem (pt_hash, namealloc("without"), _WITHOUT);
64 addhtitem (pt_hash, namealloc("precharge"), _PRECHARGE);
65 addhtitem (pt_hash, namealloc("evaluate"), _EVALUATE);
66 addhtitem (pt_hash, namealloc("multiple"), _MULTIPLE);
67 addhtitem (pt_hash, namealloc("priority"), _PRIORITY);
68 addhtitem (pt_hash, namealloc("memory"), _MEMORY);
70 return (gethtitem (pt_hash, namealloc(key)));
75 upper_case_letter [A-Z]
80 format_effector [\t\v\r\l\f]
82 lower_case_letter [a-z]
83 wildcard_letter ({upper_case_letter}|{lower_case_letter}|{wildcard})
84 wildcard_letter_or_digit ({wildcard_letter}|{digit}|{allowed})
85 decimal_literal {integer}(\.{integer})?
86 integer [\-]?{digit}(_?{digit})*
90 {end_of_line} {ECHO;yylineno++;}
91 {space_character} {ECHO;}
93 \( {ECHO;return(LeftParen);}
94 \) {ECHO;return(RightParen);}
95 \: {ECHO;return(Colon);}
96 \; {ECHO;return(Semicolon);}
97 \, {ECHO;return(Comma);}
98 \! {ECHO;return(Not);}
103 stblval.text = stripquotes(yytext);
107 {wildcard_letter}((([.]?)|(_*)){wildcard_letter_or_digit})*(\[{integer}\])? {
111 itoken = search (yytext);
112 if (itoken == EMPTYHT) {
113 stblval.text = namealloc(yytext);
123 stblval.valu = (int) strtol(yytext,(char**)NULL,10);
129 stblval.valu = (int) strtod(yytext,(char**)NULL);
130 return (decimal_literal);
135 static char *stripquotes(source)
141 while (*source != 0 && i < 1023) {
142 if ((dest[i] = source[j++]) != '"') i++;
146 return namealloc(dest);
151 return(fclose(stbin)) ;
154 int yywrap() {return 1;}