diff options
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() |