|
@ -1295,12 +1295,6 @@ typedef enum { |
|
|
|
|
|
|
|
|
language lang = C, printLang = C; |
|
|
language lang = C, printLang = C; |
|
|
|
|
|
|
|
|
// Part of creation of meta object for C |
|
|
|
|
|
|
|
|
|
|
|
void createMetaInteger() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
%} |
|
|
%} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1309,7 +1303,7 @@ language lang = C, printLang = C; |
|
|
# yylval == null => "pseudo" op, e.g., change language -- ignored by REPL |
|
|
# yylval == null => "pseudo" op, e.g., change language -- ignored by REPL |
|
|
# yylval == 0 => end of input file while in META mode only |
|
|
# yylval == 0 => end of input file while in META mode only |
|
|
|
|
|
|
|
|
start = m:metaCatch { yylval = m } |
|
|
|
|
|
|
|
|
start = m:metaCatch { yylval = null } |
|
|
| s:externalDeclaration { yylval= s } |
|
|
| s:externalDeclaration { yylval= s } |
|
|
|
|
|
|
|
|
error = EOL* < (!EOL .)* EOL* (!EOL .)* > &{ error(yytext), 1 } |
|
|
error = EOL* < (!EOL .)* EOL* (!EOL .)* > &{ error(yytext), 1 } |
|
@ -1446,12 +1440,12 @@ sCharSequence = ( escapeSequence | !EOL [^\"\\] )* |
|
|
# 6.5.1 |
|
|
# 6.5.1 |
|
|
|
|
|
|
|
|
primaryExpression = stringLiteral | constant | id |
|
|
primaryExpression = stringLiteral | constant | id |
|
|
| META_AT ( META_LCB x:mstmt |
|
|
|
|
|
| META_OPERATORS META_LPAREN x:mexp |
|
|
|
|
|
| META_LPAREN x:mexp |
|
|
|
|
|
) { $$ = eval(globals, x) } |
|
|
|
|
|
| l:LPAREN x:expression r:RPAREN { $$= new_C_subexpr(l, x, r) } |
|
|
|
|
|
| l:LPAREN x:compoundStatement r:RPAREN &{gnu} { $$= new_C_subexpr(l, x, r) } |
|
|
|
|
|
|
|
|
| META_AT ( META_LCB x:mstmt { $$ = eval(globals, x) } |
|
|
|
|
|
| META_OPERATORS META_LPAREN x:mexp { $$ = eval(globals, x) } |
|
|
|
|
|
| META_LPAREN x:mexp { $$ = eval(globals, x) } |
|
|
|
|
|
) |
|
|
|
|
|
| l:LPAREN x:expression r:RPAREN { $$= new_C_subexpr(l, x, r) } |
|
|
|
|
|
| l:LPAREN x:compoundStatement r:RPAREN &{gnu} { $$= new_C_subexpr(l, x, r) } |
|
|
|
|
|
|
|
|
# 6.5.2 |
|
|
# 6.5.2 |
|
|
|
|
|
|
|
@ -2158,19 +2152,18 @@ _FLOAT128 = '_Float128' !IDREST &{gnu} { $$= newToken("_Float1 |
|
|
# the semicolon has to be explicit with no space eaten afterwards to prevent the |
|
|
# the semicolon has to be explicit with no space eaten afterwards to prevent the |
|
|
# input buffer from moving past it before redirecting input from the imported file |
|
|
# input buffer from moving past it before redirecting input from the imported file |
|
|
|
|
|
|
|
|
metaCatch = META_AT ( META_OPERATORS META_LPAREN m:mexp { $$ = m } |
|
|
|
|
|
| META_LPAREN m:mexp { $$ = m } |
|
|
|
|
|
| META_IMPORT s:META_STRING ";" { $$ = null; inputStackPush(get(s, String, value)) } |
|
|
|
|
|
| META_LCB { $$ = null; lang= META } |
|
|
|
|
|
) |
|
|
|
|
|
| &{ lang == META } - ( META_RCB { $$ = null; lang = C } |
|
|
|
|
|
| s:meta_stmt { $$ = s } |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
metaCatch = META_AT @{ lang= META } ( META_OPERATORS META_LPAREN m:mexp { eval(globals, m) } |
|
|
|
|
|
| META_LPAREN m:mexp { eval(globals, m) } |
|
|
|
|
|
| META_IMPORT s:META_STRING ";" { inputStackPush(get(s, String, value)) } |
|
|
|
|
|
| META_LCB - (s:meta_stmt { eval(globals, s) })* META_RCB { lang = C } |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mexp = @{ lang = META } s:meta_exp META_RPAREN @{ lang = C } { $$= s } |
|
|
mexp = @{ lang = META } s:meta_exp META_RPAREN @{ lang = C } { $$= s } |
|
|
| @{ lang = C } &{ 0 } |
|
|
| @{ lang = C } &{ 0 } |
|
|
|
|
|
|
|
|
mstmt = @{ lang = META } s:meta_stmt META_RCB @{ lang = C } { $$= s } |
|
|
|
|
|
|
|
|
mstmt = @{ lang = META } - (s:meta_stmt { eval(globals, s) })* META_RCB { lang = C; $$ = s } # The last one must be a C operator |
|
|
| @{ lang = C } &{ 0 } |
|
|
| @{ lang = C } &{ 0 } |
|
|
|
|
|
|
|
|
meta_stmt = s:meta_block { $$ = s } |
|
|
meta_stmt = s:meta_block { $$ = s } |
|
|