ソースを参照

simplification of the language

develop-theo
Sebeck10 2年前
コミット
98e97dfc4e
4個のファイルの変更13行の追加13行の削除
  1. +12
    -8
      ccmeta.leg
  2. +0
    -2
      tests-parsimony/001.c
  3. +1
    -2
      tests-parsimony/002.c
  4. +0
    -1
      tests-parsimony/003.c

+ 12
- 8
ccmeta.leg ファイルの表示

@ -2170,26 +2170,28 @@ _FLOAT128 = '_Float128' !IDREST &{gnu} { $$= newToken("_Float1
# 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
metaCatch = META_AT ( m:mvalue { map_append(outputProgram, m) }
| META_LCB m:mstmts { map_append(outputProgram, m) }
| META_IMPORT s:META_STRING ";" { inputStackPush(get(s, String, value)) }
metaCatch = META_AT ( m:mvalue { map_append(outputProgram, m) }
| META_LCB m:mstmts { map_append(outputProgram, m) }
| META_IMPORT s:META_STRING ";" { inputStackPush(get(s, String, value)) }
)
mvalue = { listBegin() } ( i:META_IDENT { listAppend(eval(globals, newGetVariable(i))) }
mvalue = { listBegin() } ( i:META_IDENT { listAppend(eval(globals, newGetVariable(i))) }
| META_LPAREN ( i:MO_OPERATION
| i:meta_block
| i:meta_exp
) META_RPAREN { listAppend(eval(globals, i)) }
) { $$ = listEnd() }
) META_RPAREN { listAppend(eval(globals, i)) }
) { $$ = listEnd() }
mstmts = { listBegin() } ( s:meta_stmt { eval(globals, s) } )*
mstmts = { listBegin() } ( s:meta_stmt { eval(globals, s) }
| a:meta_append { eval(globals, a) }
)*
( (META_NIL META_SEMICOLON )? META_RCB { listEnd(); $$ = null }
| META_DAT META_SEMICOLON META_RCB { $$ = listEnd() }
)
meta_stmt = s:meta_block { $$ = s }
| META_DAT META_DOT META_APPEND META_LPAREN s:meta_exp META_RPAREN META_SEMICOLON { $$ = newUnary(Append_proto, s) }
| META_SEMICOLON { $$ = null }
| l:META_IDENT p:meta_paramList e:meta_block { $$ = newFunc(l, p, e, null) }
| META_IF META_LPAREN c:meta_exp META_RPAREN t:meta_stmt META_ELSE f:meta_stmt { $$ = newIf(c, t, f ) }
@ -2207,6 +2209,8 @@ meta_stmt = s:meta_block
| t:meta_try { $$ = t }
| e:meta_exp META_SEMICOLON { $$ = e }
meta_append = META_DAT META_DOT META_APPEND META_LPAREN s:meta_exp META_RPAREN META_SEMICOLON { $$ = newUnary(Append_proto, s) }
meta_block = META_LCB m:meta_makeMap
( s:meta_stmt { map_append(m, s) }
) *

+ 0
- 2
tests-parsimony/001.c ファイルの表示

@ -10,8 +10,6 @@
nil;
}
@(`declaration int a = 0;);
enum foo { FOO, BAR, BAZ };
char *x[] = @(newCinitializer([newCstring("X"), comma, newCstring("Y")]));
int i = @(newCint("42"));

+ 1
- 2
tests-parsimony/002.c ファイルの表示

@ -2,9 +2,8 @@
saved = `initializer (1,2,"string",21<<1);
cons = `constant 2;
two = `integer 2;
@@.append(`declaration char *test = "foo";);
@@;
}
@{print("6 outputs : \n");}
@{a = `constant 10;}
char t = @(`constant '@a');

+ 0
- 1
tests-parsimony/003.c ファイルの表示

@ -3,7 +3,6 @@
forLoop = (`statement for (int i = 0; i < 10; ++i) printf("%d\n", i););
whileLoop = `statement while (i < 10) { printf("%d\n", i); ++il; };
useForLoop = 1;
x = null;
}
int main()

読み込み中…
キャンセル
保存