%%
\$ {
- BEGIN(notes); return '$';
+ BEGIN(notes);
}
<notes>{NOTECOMMAND} {
String c = YYText() +1;
+
int l = lookup_keyword(c);
- if (l == -1) {
- String e("unknown NOTECOMMAND: \\");
- e += c;
- yyerror(e);
+ if (l != -1)
+ return l;
+ Identifier * id = lookup_identifier(c);
+ if (id) {
+ yylval.id = id;
+ return IDENTIFIER;
}
- return l;
+ String *sp = new String( c);
+ mtor << "new id: " << *sp;
+ yylval.string=sp;
+ return NEWIDENTIFIER;
}
<notes>{RESTNAME} {
}
<notes>\$ {
- BEGIN(INITIAL); return '$';
+ BEGIN(INITIAL);
}
<notes>[{}] {
return YYText()[0];
yyterminate();
}
{WORD} {
- int l = lookup_keyword(YYText());
+ String c = YYText();
+ int l = lookup_keyword(c);
if (l != -1)
return l;
- Identifier * id = lookup_identifier(YYText());
+ Identifier * id = lookup_identifier(c);
if (id) {
yylval.id = id;
return IDENTIFIER;
}
- String *sp = new String( YYText());
+ String *sp = new String( c);
mtor << "new id: " << *sp;
yylval.string=sp;
return NEWIDENTIFIER;