diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-08-21 15:24:10 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-21 15:24:10 +0000 |
commit | e95c31f841b67fc69d93ec650fe285d34f996a1e (patch) | |
tree | bb0153ba0ee01958743d31be70a73b032b3ea2fc /src/build.l | |
parent | 4887f62bea708f24e03b3f926f2698c60a94c807 (diff) | |
download | build-e95c31f841b67fc69d93ec650fe285d34f996a1e.tar.gz build-e95c31f841b67fc69d93ec650fe285d34f996a1e.tar.bz2 build-e95c31f841b67fc69d93ec650fe285d34f996a1e.tar.xz build-e95c31f841b67fc69d93ec650fe285d34f996a1e.zip |
Alright, the grammer is almost there, just debugging, in what I call extreme-
debugging mode. If you wanted something intelligable, don't use this one.
Diffstat (limited to 'src/build.l')
-rw-r--r-- | src/build.l | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/build.l b/src/build.l index 9a15719..8189f9d 100644 --- a/src/build.l +++ b/src/build.l | |||
@@ -18,7 +18,7 @@ std::string strbuf; | |||
18 | %} | 18 | %} |
19 | %% | 19 | %% |
20 | 20 | ||
21 | [,:=[\]] return yytext[0]; | 21 | [,:=[\]()] return yytext[0]; |
22 | "+=" return TOK_ADDSET; | 22 | "+=" return TOK_ADDSET; |
23 | 23 | ||
24 | "default" return TOK_DEFAULT; | 24 | "default" return TOK_DEFAULT; |
@@ -32,6 +32,7 @@ std::string strbuf; | |||
32 | "check" return TOK_CHECK; | 32 | "check" return TOK_CHECK; |
33 | "clean" return TOK_CLEAN; | 33 | "clean" return TOK_CLEAN; |
34 | "target" return TOK_TARGET; | 34 | "target" return TOK_TARGET; |
35 | "input" return TOK_INPUT; | ||
35 | 36 | ||
36 | \n+ { | 37 | \n+ { |
37 | yylloc->last_line += yyleng; | 38 | yylloc->last_line += yyleng; |
@@ -59,6 +60,27 @@ std::string strbuf; | |||
59 | 60 | ||
60 | "#".* /* single line comment */ | 61 | "#".* /* single line comment */ |
61 | 62 | ||
63 | [a-zA-Z][a-zA-Z0-9]* { | ||
64 | { | ||
65 | yylval->tval = bld.getTargetType( yytext ); | ||
66 | if( yylval->tval >= 0 ) | ||
67 | { | ||
68 | return TARGETTYPE; | ||
69 | } | ||
70 | else if( bld.isFunction( yytext ) ) | ||
71 | { | ||
72 | yylval->strval = stringdup( yytext ); | ||
73 | return FUNCTION; | ||
74 | } | ||
75 | bld.error( yylloc, "Invalid token" ); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | [^ \t\r\n\'\":=,/][^ \t\r\n\'\"=,]+[^ \t\r\n\'\":=,] { | ||
80 | yylval->strval = stringdup( yytext ); | ||
81 | return STRING; | ||
82 | } | ||
83 | |||
62 | \" { | 84 | \" { |
63 | BEGIN( strdq ); | 85 | BEGIN( strdq ); |
64 | strbuf = ""; | 86 | strbuf = ""; |
@@ -94,6 +116,10 @@ std::string strbuf; | |||
94 | return STRING; | 116 | return STRING; |
95 | } | 117 | } |
96 | 118 | ||
119 | . { | ||
120 | bld.error( yylloc, "Invalid character found!" ); | ||
121 | } | ||
122 | |||
97 | %% | 123 | %% |
98 | 124 | ||
99 | void Builder::scanBegin() | 125 | void Builder::scanBegin() |