File: bnf.jisonlex

package info (click to toggle)
node-lex-parser 0.1.4-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: javascript: 327; yacc: 190; makefile: 15
file content (23 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

%%
\s+		{/* skip whitespace */}
"/*"[^*]*"*"		{return yy.lexComment(this);}
[a-zA-Z][a-zA-Z0-9_-]*		{return 'ID';}
'"'[^"]+'"'		{yytext = yytext.substr(1, yyleng-2); return 'STRING';}
"'"[^']+"'"		{yytext = yytext.substr(1, yyleng-2); return 'STRING';}
":"		{return ':';}
";"		{return ';';}
"|"		{return '|';}
"%%"		{return '%%';}
"%prec"		{return 'PREC';}
"%start"		{return 'START';}
"%left"		{return 'LEFT';}
"%right"		{return 'RIGHT';}
"%nonassoc"		{return 'NONASSOC';}
"%"[a-zA-Z]+[^\n]*		{/* ignore unrecognized decl */}
"{{"[^}]*"}"		{return yy.lexAction(this);}
"{"[^}]*"}"		{yytext = yytext.substr(1, yyleng-2); return 'ACTION';}
"<"[^>]*">"		{yytext = yytext.substr(1, yyleng-2); return 'ACTION';}
.		{/* ignore bad characters */}
<<EOF>>		{return 'EOF';}