tmp
This commit is contained in:
parent
8dc73bc1d5
commit
505b77da3f
3 changed files with 1177 additions and 878 deletions
|
|
@ -158,27 +158,10 @@ void bind(LalrParser& parser) {
|
||||||
BIND(stm_var_def_assign);
|
BIND(stm_var_def_assign);
|
||||||
BIND(stm_log);
|
BIND(stm_log);
|
||||||
BIND(stm_assign);
|
BIND(stm_assign);
|
||||||
|
stm_while_loop stm_return stm_break BIND(expr_function) BIND(expr_method) BIND(expr_child) BIND(expr_bool_eq)
|
||||||
BIND(expr_function)
|
BIND(expr_bool_negate) BIND(expr_bool_neq) BIND(expr_bool_grater) BIND(expr_bool_lesser) BIND(expr_bool_grater_eq)
|
||||||
BIND(expr_method)
|
BIND(expr_bool_lesser_eq) BIND(expr_add) BIND(expr_subtract) BIND(expr_multiply) BIND(expr_divide)
|
||||||
BIND(expr_child)
|
BIND(expr_compound) BIND(expr_bool) BIND(expr_int) BIND(expr_float) BIND(expr_string) BIND(expr_id)
|
||||||
BIND(expr_bool_eq)
|
|
||||||
BIND(expr_bool_negate)
|
|
||||||
BIND(expr_bool_neq)
|
|
||||||
BIND(expr_bool_grater)
|
|
||||||
BIND(expr_bool_lesser)
|
|
||||||
BIND(expr_bool_grater_eq)
|
|
||||||
BIND(expr_bool_lesser_eq)
|
|
||||||
BIND(expr_add)
|
|
||||||
BIND(expr_subtract)
|
|
||||||
BIND(expr_multiply)
|
|
||||||
BIND(expr_divide)
|
|
||||||
BIND(expr_compound)
|
|
||||||
BIND(expr_bool)
|
|
||||||
BIND(expr_int)
|
|
||||||
BIND(expr_float)
|
|
||||||
BIND(expr_string)
|
|
||||||
BIND(expr_id)
|
|
||||||
|
|
||||||
BIND(tmp)
|
BIND(tmp)
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -7,6 +7,9 @@ oscript {
|
||||||
%left '*' '/';
|
%left '*' '/';
|
||||||
%left '.' '=';
|
%left '.' '=';
|
||||||
%left '==' '>' '<' '>=' '<=' '!=' '!';
|
%left '==' '>' '<' '>=' '<=' '!=' '!';
|
||||||
|
%left ';';
|
||||||
|
|
||||||
|
script : stmts [tmp];
|
||||||
|
|
||||||
scope:
|
scope:
|
||||||
'{' stmts '}' [scope]
|
'{' stmts '}' [scope]
|
||||||
|
|
@ -22,8 +25,24 @@ oscript {
|
||||||
| stm_var_def_assign [tmp]
|
| stm_var_def_assign [tmp]
|
||||||
| stm_log [tmp]
|
| stm_log [tmp]
|
||||||
| stm_assign [tmp]
|
| stm_assign [tmp]
|
||||||
|
| stm_while [tmp]
|
||||||
|
| stm_return [tmp]
|
||||||
|
| stm_break [tmp]
|
||||||
|
| stm_if [tmp]
|
||||||
|
| stm_def_class [tmp]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
stm_def_method: 'class' id scope [stm_def_class];
|
||||||
|
|
||||||
|
stm_def_class: 'class' id scope [stm_def_class];
|
||||||
|
|
||||||
|
stm_if:
|
||||||
|
'if' '(' expr ')' scope [stm_if]
|
||||||
|
| 'if' '(' expr ')' scope 'else' scope [stm_if];
|
||||||
|
|
||||||
|
stm_break: 'break' [stm_break];
|
||||||
|
stm_return: 'return' expr [stm_return] | 'return' [stm_return];
|
||||||
|
stm_while: 'while' '(' expr ')' scope [stm_while_loop];
|
||||||
stm_var_def_new_type: 'var' id ':' id [stm_var_def_new_type];
|
stm_var_def_new_type: 'var' id ':' id [stm_var_def_new_type];
|
||||||
stm_var_def_assign: 'var' id '=' expr [stm_var_def_assign];
|
stm_var_def_assign: 'var' id '=' expr [stm_var_def_assign];
|
||||||
stm_log: 'print' expr [stm_log];
|
stm_log: 'print' expr [stm_log];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue