impl negate expression properly
This commit is contained in:
parent
9910527d60
commit
242ee33f07
@ -190,6 +190,7 @@ xsk::gsc::h1::parser::symbol_type H1lex(xsk::gsc::h1::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -214,7 +215,6 @@ xsk::gsc::h1::parser::symbol_type H1lex(xsk::gsc::h1::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -612,6 +612,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -630,7 +631,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -646,6 +646,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -798,11 +809,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -190,6 +190,7 @@ xsk::gsc::h2::parser::symbol_type H2lex(xsk::gsc::h2::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -214,7 +215,6 @@ xsk::gsc::h2::parser::symbol_type H2lex(xsk::gsc::h2::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -612,6 +612,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -630,7 +631,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -646,6 +646,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -798,11 +809,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -188,6 +188,7 @@ xsk::gsc::iw5::parser::symbol_type IW5lex(xsk::gsc::iw5::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -212,7 +213,6 @@ xsk::gsc::iw5::parser::symbol_type IW5lex(xsk::gsc::iw5::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -602,6 +602,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -620,7 +621,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -636,6 +636,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -788,11 +799,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -188,6 +188,7 @@ xsk::gsc::iw6::parser::symbol_type IW6lex(xsk::gsc::iw6::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -212,7 +213,6 @@ xsk::gsc::iw6::parser::symbol_type IW6lex(xsk::gsc::iw6::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -602,6 +602,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -620,7 +621,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -636,6 +636,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -788,11 +799,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -188,6 +188,7 @@ xsk::gsc::iw7::parser::symbol_type IW7lex(xsk::gsc::iw7::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -212,7 +213,6 @@ xsk::gsc::iw7::parser::symbol_type IW7lex(xsk::gsc::iw7::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -602,6 +602,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -620,7 +621,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -636,6 +636,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -788,11 +799,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -192,6 +192,7 @@ xsk::gsc::iw8::parser::symbol_type IW8lex(xsk::gsc::iw8::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -218,7 +219,6 @@ xsk::gsc::iw8::parser::symbol_type IW8lex(xsk::gsc::iw8::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -616,6 +616,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -636,7 +637,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -652,6 +652,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -814,11 +825,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -190,6 +190,7 @@ xsk::gsc::s1::parser::symbol_type S1lex(xsk::gsc::s1::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -214,7 +215,6 @@ xsk::gsc::s1::parser::symbol_type S1lex(xsk::gsc::s1::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -612,6 +612,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -630,7 +631,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -646,6 +646,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -798,11 +809,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -190,6 +190,7 @@ xsk::gsc::s2::parser::symbol_type S2lex(xsk::gsc::s2::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -214,7 +215,6 @@ xsk::gsc::s2::parser::symbol_type S2lex(xsk::gsc::s2::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -612,6 +612,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -630,7 +631,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -646,6 +646,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -798,11 +809,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -192,6 +192,7 @@ xsk::gsc::s4::parser::symbol_type S4lex(xsk::gsc::s4::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -218,7 +219,6 @@ xsk::gsc::s4::parser::symbol_type S4lex(xsk::gsc::s4::lexer& lexer);
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr_animtree::ptr> expr_animtree
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -616,6 +616,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -636,7 +637,6 @@ expr_primitive
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_animtree { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -652,6 +652,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -814,11 +825,6 @@ expr_animtree
|
||||
{ $$ = std::make_unique<ast::expr_animtree>(@$); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -202,6 +202,7 @@ xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer);
|
||||
%type <ast::expr> expr_binary
|
||||
%type <ast::expr> expr_primitive
|
||||
%type <ast::expr_complement::ptr> expr_complement
|
||||
%type <ast::expr_negate::ptr> expr_negate
|
||||
%type <ast::expr_not::ptr> expr_not
|
||||
%type <ast::expr_call::ptr> expr_call
|
||||
%type <ast::expr_method::ptr> expr_method
|
||||
@ -242,7 +243,6 @@ xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer);
|
||||
%type <ast::expr_anim::ptr> expr_anim
|
||||
%type <ast::expr_level::ptr> expr_level
|
||||
%type <ast::expr_animation::ptr> expr_animation
|
||||
%type <ast::expr> expr_identifier_neg
|
||||
%type <ast::expr_identifier::ptr> expr_identifier_nosize
|
||||
%type <ast::expr_identifier::ptr> expr_identifier
|
||||
%type <ast::expr_path::ptr> expr_path
|
||||
@ -626,6 +626,7 @@ expr_binary
|
||||
|
||||
expr_primitive
|
||||
: expr_complement { $$.as_node = std::move($1); }
|
||||
| expr_negate { $$.as_node = std::move($1); }
|
||||
| expr_not { $$.as_node = std::move($1); }
|
||||
| expr_call { $$.as_node = std::move($1); }
|
||||
| expr_method { $$.as_node = std::move($1); }
|
||||
@ -660,7 +661,6 @@ expr_primitive
|
||||
| expr_anim { $$.as_node = std::move($1); }
|
||||
| expr_level { $$.as_node = std::move($1); }
|
||||
| expr_animation { $$.as_node = std::move($1); }
|
||||
| expr_identifier_neg { $$ = std::move($1); }
|
||||
| expr_identifier { $$.as_node = std::move($1); }
|
||||
| expr_istring { $$.as_node = std::move($1); }
|
||||
| expr_string { $$.as_node = std::move($1); }
|
||||
@ -677,6 +677,17 @@ expr_complement
|
||||
{ $$ = std::make_unique<ast::expr_complement>(@$, std::move($2)); }
|
||||
;
|
||||
|
||||
expr_negate
|
||||
: SUB expr_identifier %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_paren %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_array %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
| SUB expr_field %prec NEG
|
||||
{ $$ = std::make_unique<ast::expr_negate>(@$, ast::expr(std::move($2))); }
|
||||
;
|
||||
|
||||
expr_not
|
||||
: NOT expr
|
||||
{ $$ = std::make_unique<ast::expr_not>(@$, std::move($2)); }
|
||||
@ -915,11 +926,6 @@ expr_animation
|
||||
{ $$ = std::make_unique<ast::expr_animation>(@$, $2); };
|
||||
;
|
||||
|
||||
expr_identifier_neg
|
||||
: SUB IDENTIFIER
|
||||
{ $$.as_node = std::make_unique<ast::expr_sub>(@$, ast::expr(std::make_unique<ast::expr_integer>(@$, "0")), ast::expr(std::make_unique<ast::expr_identifier>(@$, $2))); }
|
||||
;
|
||||
|
||||
expr_identifier_nosize
|
||||
: IDENTIFIER
|
||||
{ $$ = std::make_unique<ast::expr_identifier>(@$, $1); };
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1259,6 +1262,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,134 +505,137 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy62[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -641,7 +643,7 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy67[sizeof (std::string)];
|
||||
char dummy68[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -984,31 +986,31 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
S_expr_binary = 159, // expr_binary
|
||||
S_expr_primitive = 160, // expr_primitive
|
||||
S_expr_complement = 161, // expr_complement
|
||||
S_expr_not = 162, // expr_not
|
||||
S_expr_call = 163, // expr_call
|
||||
S_expr_method = 164, // expr_method
|
||||
S_expr_function = 165, // expr_function
|
||||
S_expr_pointer = 166, // expr_pointer
|
||||
S_expr_add_array = 167, // expr_add_array
|
||||
S_expr_parameters = 168, // expr_parameters
|
||||
S_expr_arguments = 169, // expr_arguments
|
||||
S_expr_arguments_no_empty = 170, // expr_arguments_no_empty
|
||||
S_expr_reference = 171, // expr_reference
|
||||
S_expr_array = 172, // expr_array
|
||||
S_expr_field = 173, // expr_field
|
||||
S_expr_size = 174, // expr_size
|
||||
S_expr_paren = 175, // expr_paren
|
||||
S_expr_object = 176, // expr_object
|
||||
S_expr_thisthread = 177, // expr_thisthread
|
||||
S_expr_empty_array = 178, // expr_empty_array
|
||||
S_expr_undefined = 179, // expr_undefined
|
||||
S_expr_game = 180, // expr_game
|
||||
S_expr_self = 181, // expr_self
|
||||
S_expr_anim = 182, // expr_anim
|
||||
S_expr_level = 183, // expr_level
|
||||
S_expr_animation = 184, // expr_animation
|
||||
S_expr_animtree = 185, // expr_animtree
|
||||
S_expr_identifier_neg = 186, // expr_identifier_neg
|
||||
S_expr_negate = 162, // expr_negate
|
||||
S_expr_not = 163, // expr_not
|
||||
S_expr_call = 164, // expr_call
|
||||
S_expr_method = 165, // expr_method
|
||||
S_expr_function = 166, // expr_function
|
||||
S_expr_pointer = 167, // expr_pointer
|
||||
S_expr_add_array = 168, // expr_add_array
|
||||
S_expr_parameters = 169, // expr_parameters
|
||||
S_expr_arguments = 170, // expr_arguments
|
||||
S_expr_arguments_no_empty = 171, // expr_arguments_no_empty
|
||||
S_expr_reference = 172, // expr_reference
|
||||
S_expr_array = 173, // expr_array
|
||||
S_expr_field = 174, // expr_field
|
||||
S_expr_size = 175, // expr_size
|
||||
S_expr_paren = 176, // expr_paren
|
||||
S_expr_object = 177, // expr_object
|
||||
S_expr_thisthread = 178, // expr_thisthread
|
||||
S_expr_empty_array = 179, // expr_empty_array
|
||||
S_expr_undefined = 180, // expr_undefined
|
||||
S_expr_game = 181, // expr_game
|
||||
S_expr_self = 182, // expr_self
|
||||
S_expr_anim = 183, // expr_anim
|
||||
S_expr_level = 184, // expr_level
|
||||
S_expr_animation = 185, // expr_animation
|
||||
S_expr_animtree = 186, // expr_animtree
|
||||
S_expr_identifier_nosize = 187, // expr_identifier_nosize
|
||||
S_expr_identifier = 188, // expr_identifier
|
||||
S_expr_path = 189, // expr_path
|
||||
@ -1085,7 +1087,6 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1163,6 +1164,10 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1702,6 +1707,20 @@ namespace xsk { namespace gsc { namespace h1 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2358,7 +2377,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2436,6 +2454,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4817,7 +4839,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2310, ///< Last index in yytable_.
|
||||
yylast_ = 2419, ///< Last index in yytable_.
|
||||
yynnts_ = 84, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4875,7 +4897,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4953,6 +4974,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5194,7 +5219,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5272,6 +5296,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5519,7 +5547,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::h1
|
||||
#line 5523 "parser.hpp"
|
||||
#line 5551 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1259,6 +1262,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,134 +505,137 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy62[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -641,7 +643,7 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy67[sizeof (std::string)];
|
||||
char dummy68[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -984,31 +986,31 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
S_expr_binary = 159, // expr_binary
|
||||
S_expr_primitive = 160, // expr_primitive
|
||||
S_expr_complement = 161, // expr_complement
|
||||
S_expr_not = 162, // expr_not
|
||||
S_expr_call = 163, // expr_call
|
||||
S_expr_method = 164, // expr_method
|
||||
S_expr_function = 165, // expr_function
|
||||
S_expr_pointer = 166, // expr_pointer
|
||||
S_expr_add_array = 167, // expr_add_array
|
||||
S_expr_parameters = 168, // expr_parameters
|
||||
S_expr_arguments = 169, // expr_arguments
|
||||
S_expr_arguments_no_empty = 170, // expr_arguments_no_empty
|
||||
S_expr_reference = 171, // expr_reference
|
||||
S_expr_array = 172, // expr_array
|
||||
S_expr_field = 173, // expr_field
|
||||
S_expr_size = 174, // expr_size
|
||||
S_expr_paren = 175, // expr_paren
|
||||
S_expr_object = 176, // expr_object
|
||||
S_expr_thisthread = 177, // expr_thisthread
|
||||
S_expr_empty_array = 178, // expr_empty_array
|
||||
S_expr_undefined = 179, // expr_undefined
|
||||
S_expr_game = 180, // expr_game
|
||||
S_expr_self = 181, // expr_self
|
||||
S_expr_anim = 182, // expr_anim
|
||||
S_expr_level = 183, // expr_level
|
||||
S_expr_animation = 184, // expr_animation
|
||||
S_expr_animtree = 185, // expr_animtree
|
||||
S_expr_identifier_neg = 186, // expr_identifier_neg
|
||||
S_expr_negate = 162, // expr_negate
|
||||
S_expr_not = 163, // expr_not
|
||||
S_expr_call = 164, // expr_call
|
||||
S_expr_method = 165, // expr_method
|
||||
S_expr_function = 166, // expr_function
|
||||
S_expr_pointer = 167, // expr_pointer
|
||||
S_expr_add_array = 168, // expr_add_array
|
||||
S_expr_parameters = 169, // expr_parameters
|
||||
S_expr_arguments = 170, // expr_arguments
|
||||
S_expr_arguments_no_empty = 171, // expr_arguments_no_empty
|
||||
S_expr_reference = 172, // expr_reference
|
||||
S_expr_array = 173, // expr_array
|
||||
S_expr_field = 174, // expr_field
|
||||
S_expr_size = 175, // expr_size
|
||||
S_expr_paren = 176, // expr_paren
|
||||
S_expr_object = 177, // expr_object
|
||||
S_expr_thisthread = 178, // expr_thisthread
|
||||
S_expr_empty_array = 179, // expr_empty_array
|
||||
S_expr_undefined = 180, // expr_undefined
|
||||
S_expr_game = 181, // expr_game
|
||||
S_expr_self = 182, // expr_self
|
||||
S_expr_anim = 183, // expr_anim
|
||||
S_expr_level = 184, // expr_level
|
||||
S_expr_animation = 185, // expr_animation
|
||||
S_expr_animtree = 186, // expr_animtree
|
||||
S_expr_identifier_nosize = 187, // expr_identifier_nosize
|
||||
S_expr_identifier = 188, // expr_identifier
|
||||
S_expr_path = 189, // expr_path
|
||||
@ -1085,7 +1087,6 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1163,6 +1164,10 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1702,6 +1707,20 @@ namespace xsk { namespace gsc { namespace h2 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2358,7 +2377,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2436,6 +2454,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4817,7 +4839,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2310, ///< Last index in yytable_.
|
||||
yylast_ = 2419, ///< Last index in yytable_.
|
||||
yynnts_ = 84, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4875,7 +4897,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4953,6 +4974,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5194,7 +5219,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5272,6 +5296,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5519,7 +5547,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::h2
|
||||
#line 5523 "parser.hpp"
|
||||
#line 5551 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -938,6 +938,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1251,6 +1254,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -82,6 +82,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,131 +505,134 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy62[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy63[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy64[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy65[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -638,7 +640,7 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy66[sizeof (std::string)];
|
||||
char dummy67[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -978,31 +980,31 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
S_expr_binary = 157, // expr_binary
|
||||
S_expr_primitive = 158, // expr_primitive
|
||||
S_expr_complement = 159, // expr_complement
|
||||
S_expr_not = 160, // expr_not
|
||||
S_expr_call = 161, // expr_call
|
||||
S_expr_method = 162, // expr_method
|
||||
S_expr_function = 163, // expr_function
|
||||
S_expr_pointer = 164, // expr_pointer
|
||||
S_expr_add_array = 165, // expr_add_array
|
||||
S_expr_parameters = 166, // expr_parameters
|
||||
S_expr_arguments = 167, // expr_arguments
|
||||
S_expr_arguments_no_empty = 168, // expr_arguments_no_empty
|
||||
S_expr_reference = 169, // expr_reference
|
||||
S_expr_array = 170, // expr_array
|
||||
S_expr_field = 171, // expr_field
|
||||
S_expr_size = 172, // expr_size
|
||||
S_expr_paren = 173, // expr_paren
|
||||
S_expr_object = 174, // expr_object
|
||||
S_expr_thisthread = 175, // expr_thisthread
|
||||
S_expr_empty_array = 176, // expr_empty_array
|
||||
S_expr_undefined = 177, // expr_undefined
|
||||
S_expr_game = 178, // expr_game
|
||||
S_expr_self = 179, // expr_self
|
||||
S_expr_anim = 180, // expr_anim
|
||||
S_expr_level = 181, // expr_level
|
||||
S_expr_animation = 182, // expr_animation
|
||||
S_expr_animtree = 183, // expr_animtree
|
||||
S_expr_identifier_neg = 184, // expr_identifier_neg
|
||||
S_expr_negate = 160, // expr_negate
|
||||
S_expr_not = 161, // expr_not
|
||||
S_expr_call = 162, // expr_call
|
||||
S_expr_method = 163, // expr_method
|
||||
S_expr_function = 164, // expr_function
|
||||
S_expr_pointer = 165, // expr_pointer
|
||||
S_expr_add_array = 166, // expr_add_array
|
||||
S_expr_parameters = 167, // expr_parameters
|
||||
S_expr_arguments = 168, // expr_arguments
|
||||
S_expr_arguments_no_empty = 169, // expr_arguments_no_empty
|
||||
S_expr_reference = 170, // expr_reference
|
||||
S_expr_array = 171, // expr_array
|
||||
S_expr_field = 172, // expr_field
|
||||
S_expr_size = 173, // expr_size
|
||||
S_expr_paren = 174, // expr_paren
|
||||
S_expr_object = 175, // expr_object
|
||||
S_expr_thisthread = 176, // expr_thisthread
|
||||
S_expr_empty_array = 177, // expr_empty_array
|
||||
S_expr_undefined = 178, // expr_undefined
|
||||
S_expr_game = 179, // expr_game
|
||||
S_expr_self = 180, // expr_self
|
||||
S_expr_anim = 181, // expr_anim
|
||||
S_expr_level = 182, // expr_level
|
||||
S_expr_animation = 183, // expr_animation
|
||||
S_expr_animtree = 184, // expr_animtree
|
||||
S_expr_identifier_nosize = 185, // expr_identifier_nosize
|
||||
S_expr_identifier = 186, // expr_identifier
|
||||
S_expr_path = 187, // expr_path
|
||||
@ -1079,7 +1081,6 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1157,6 +1158,10 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1692,6 +1697,20 @@ namespace xsk { namespace gsc { namespace iw5 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2334,7 +2353,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2412,6 +2430,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4774,7 +4796,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2239, ///< Last index in yytable_.
|
||||
yylast_ = 2363, ///< Last index in yytable_.
|
||||
yynnts_ = 83, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4832,7 +4854,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4910,6 +4931,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5147,7 +5172,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5225,6 +5249,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5468,7 +5496,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::iw5
|
||||
#line 5472 "parser.hpp"
|
||||
#line 5500 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -938,6 +938,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1251,6 +1254,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -82,6 +82,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,131 +505,134 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy62[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy63[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy64[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy65[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -638,7 +640,7 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy66[sizeof (std::string)];
|
||||
char dummy67[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -978,31 +980,31 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
S_expr_binary = 157, // expr_binary
|
||||
S_expr_primitive = 158, // expr_primitive
|
||||
S_expr_complement = 159, // expr_complement
|
||||
S_expr_not = 160, // expr_not
|
||||
S_expr_call = 161, // expr_call
|
||||
S_expr_method = 162, // expr_method
|
||||
S_expr_function = 163, // expr_function
|
||||
S_expr_pointer = 164, // expr_pointer
|
||||
S_expr_add_array = 165, // expr_add_array
|
||||
S_expr_parameters = 166, // expr_parameters
|
||||
S_expr_arguments = 167, // expr_arguments
|
||||
S_expr_arguments_no_empty = 168, // expr_arguments_no_empty
|
||||
S_expr_reference = 169, // expr_reference
|
||||
S_expr_array = 170, // expr_array
|
||||
S_expr_field = 171, // expr_field
|
||||
S_expr_size = 172, // expr_size
|
||||
S_expr_paren = 173, // expr_paren
|
||||
S_expr_object = 174, // expr_object
|
||||
S_expr_thisthread = 175, // expr_thisthread
|
||||
S_expr_empty_array = 176, // expr_empty_array
|
||||
S_expr_undefined = 177, // expr_undefined
|
||||
S_expr_game = 178, // expr_game
|
||||
S_expr_self = 179, // expr_self
|
||||
S_expr_anim = 180, // expr_anim
|
||||
S_expr_level = 181, // expr_level
|
||||
S_expr_animation = 182, // expr_animation
|
||||
S_expr_animtree = 183, // expr_animtree
|
||||
S_expr_identifier_neg = 184, // expr_identifier_neg
|
||||
S_expr_negate = 160, // expr_negate
|
||||
S_expr_not = 161, // expr_not
|
||||
S_expr_call = 162, // expr_call
|
||||
S_expr_method = 163, // expr_method
|
||||
S_expr_function = 164, // expr_function
|
||||
S_expr_pointer = 165, // expr_pointer
|
||||
S_expr_add_array = 166, // expr_add_array
|
||||
S_expr_parameters = 167, // expr_parameters
|
||||
S_expr_arguments = 168, // expr_arguments
|
||||
S_expr_arguments_no_empty = 169, // expr_arguments_no_empty
|
||||
S_expr_reference = 170, // expr_reference
|
||||
S_expr_array = 171, // expr_array
|
||||
S_expr_field = 172, // expr_field
|
||||
S_expr_size = 173, // expr_size
|
||||
S_expr_paren = 174, // expr_paren
|
||||
S_expr_object = 175, // expr_object
|
||||
S_expr_thisthread = 176, // expr_thisthread
|
||||
S_expr_empty_array = 177, // expr_empty_array
|
||||
S_expr_undefined = 178, // expr_undefined
|
||||
S_expr_game = 179, // expr_game
|
||||
S_expr_self = 180, // expr_self
|
||||
S_expr_anim = 181, // expr_anim
|
||||
S_expr_level = 182, // expr_level
|
||||
S_expr_animation = 183, // expr_animation
|
||||
S_expr_animtree = 184, // expr_animtree
|
||||
S_expr_identifier_nosize = 185, // expr_identifier_nosize
|
||||
S_expr_identifier = 186, // expr_identifier
|
||||
S_expr_path = 187, // expr_path
|
||||
@ -1079,7 +1081,6 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1157,6 +1158,10 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1692,6 +1697,20 @@ namespace xsk { namespace gsc { namespace iw6 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2334,7 +2353,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2412,6 +2430,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4774,7 +4796,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2239, ///< Last index in yytable_.
|
||||
yylast_ = 2363, ///< Last index in yytable_.
|
||||
yynnts_ = 83, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4832,7 +4854,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4910,6 +4931,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5147,7 +5172,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5225,6 +5249,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5468,7 +5496,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::iw6
|
||||
#line 5472 "parser.hpp"
|
||||
#line 5500 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -938,6 +938,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1251,6 +1254,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -82,6 +82,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,131 +505,134 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy62[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy63[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy64[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy65[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -638,7 +640,7 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy66[sizeof (std::string)];
|
||||
char dummy67[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -978,31 +980,31 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
S_expr_binary = 157, // expr_binary
|
||||
S_expr_primitive = 158, // expr_primitive
|
||||
S_expr_complement = 159, // expr_complement
|
||||
S_expr_not = 160, // expr_not
|
||||
S_expr_call = 161, // expr_call
|
||||
S_expr_method = 162, // expr_method
|
||||
S_expr_function = 163, // expr_function
|
||||
S_expr_pointer = 164, // expr_pointer
|
||||
S_expr_add_array = 165, // expr_add_array
|
||||
S_expr_parameters = 166, // expr_parameters
|
||||
S_expr_arguments = 167, // expr_arguments
|
||||
S_expr_arguments_no_empty = 168, // expr_arguments_no_empty
|
||||
S_expr_reference = 169, // expr_reference
|
||||
S_expr_array = 170, // expr_array
|
||||
S_expr_field = 171, // expr_field
|
||||
S_expr_size = 172, // expr_size
|
||||
S_expr_paren = 173, // expr_paren
|
||||
S_expr_object = 174, // expr_object
|
||||
S_expr_thisthread = 175, // expr_thisthread
|
||||
S_expr_empty_array = 176, // expr_empty_array
|
||||
S_expr_undefined = 177, // expr_undefined
|
||||
S_expr_game = 178, // expr_game
|
||||
S_expr_self = 179, // expr_self
|
||||
S_expr_anim = 180, // expr_anim
|
||||
S_expr_level = 181, // expr_level
|
||||
S_expr_animation = 182, // expr_animation
|
||||
S_expr_animtree = 183, // expr_animtree
|
||||
S_expr_identifier_neg = 184, // expr_identifier_neg
|
||||
S_expr_negate = 160, // expr_negate
|
||||
S_expr_not = 161, // expr_not
|
||||
S_expr_call = 162, // expr_call
|
||||
S_expr_method = 163, // expr_method
|
||||
S_expr_function = 164, // expr_function
|
||||
S_expr_pointer = 165, // expr_pointer
|
||||
S_expr_add_array = 166, // expr_add_array
|
||||
S_expr_parameters = 167, // expr_parameters
|
||||
S_expr_arguments = 168, // expr_arguments
|
||||
S_expr_arguments_no_empty = 169, // expr_arguments_no_empty
|
||||
S_expr_reference = 170, // expr_reference
|
||||
S_expr_array = 171, // expr_array
|
||||
S_expr_field = 172, // expr_field
|
||||
S_expr_size = 173, // expr_size
|
||||
S_expr_paren = 174, // expr_paren
|
||||
S_expr_object = 175, // expr_object
|
||||
S_expr_thisthread = 176, // expr_thisthread
|
||||
S_expr_empty_array = 177, // expr_empty_array
|
||||
S_expr_undefined = 178, // expr_undefined
|
||||
S_expr_game = 179, // expr_game
|
||||
S_expr_self = 180, // expr_self
|
||||
S_expr_anim = 181, // expr_anim
|
||||
S_expr_level = 182, // expr_level
|
||||
S_expr_animation = 183, // expr_animation
|
||||
S_expr_animtree = 184, // expr_animtree
|
||||
S_expr_identifier_nosize = 185, // expr_identifier_nosize
|
||||
S_expr_identifier = 186, // expr_identifier
|
||||
S_expr_path = 187, // expr_path
|
||||
@ -1079,7 +1081,6 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1157,6 +1158,10 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1692,6 +1697,20 @@ namespace xsk { namespace gsc { namespace iw7 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2334,7 +2353,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2412,6 +2430,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4774,7 +4796,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2239, ///< Last index in yytable_.
|
||||
yylast_ = 2363, ///< Last index in yytable_.
|
||||
yynnts_ = 83, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4832,7 +4854,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4910,6 +4931,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5147,7 +5172,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5225,6 +5249,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5468,7 +5496,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::iw7
|
||||
#line 5472 "parser.hpp"
|
||||
#line 5500 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1283,6 +1286,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -512,134 +511,137 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
// expr_method
|
||||
char dummy26[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy27[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy27[sizeof (ast::expr_not::ptr)];
|
||||
char dummy28[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy28[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy29[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy29[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy30[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy30[sizeof (ast::expr_path::ptr)];
|
||||
char dummy31[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy31[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy32[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy32[sizeof (ast::expr_self::ptr)];
|
||||
char dummy33[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy33[sizeof (ast::expr_size::ptr)];
|
||||
char dummy34[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy34[sizeof (ast::expr_string::ptr)];
|
||||
char dummy35[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy35[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy36[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy36[sizeof (ast::expr_true::ptr)];
|
||||
char dummy37[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy37[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy38[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy38[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy39[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy39[sizeof (ast::include::ptr)];
|
||||
char dummy40[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy40[sizeof (ast::program::ptr)];
|
||||
char dummy41[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy41[sizeof (ast::stmt)];
|
||||
char dummy42[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy42[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy43[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy44[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy45[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy46[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy47[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy48[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy49[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy50[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy51[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy52[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy53[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy54[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy55[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy56[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy57[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy58[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy59[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy60[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy61[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy62[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy63[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy64[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy65[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy66[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy67[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy68[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy68[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy69[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -647,7 +649,7 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy69[sizeof (std::string)];
|
||||
char dummy70[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -994,33 +996,33 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
S_expr_binary = 161, // expr_binary
|
||||
S_expr_primitive = 162, // expr_primitive
|
||||
S_expr_complement = 163, // expr_complement
|
||||
S_expr_not = 164, // expr_not
|
||||
S_expr_call = 165, // expr_call
|
||||
S_expr_method = 166, // expr_method
|
||||
S_expr_function = 167, // expr_function
|
||||
S_expr_pointer = 168, // expr_pointer
|
||||
S_expr_add_array = 169, // expr_add_array
|
||||
S_expr_parameters = 170, // expr_parameters
|
||||
S_expr_arguments = 171, // expr_arguments
|
||||
S_expr_arguments_no_empty = 172, // expr_arguments_no_empty
|
||||
S_expr_isdefined = 173, // expr_isdefined
|
||||
S_expr_istrue = 174, // expr_istrue
|
||||
S_expr_reference = 175, // expr_reference
|
||||
S_expr_array = 176, // expr_array
|
||||
S_expr_field = 177, // expr_field
|
||||
S_expr_size = 178, // expr_size
|
||||
S_expr_paren = 179, // expr_paren
|
||||
S_expr_object = 180, // expr_object
|
||||
S_expr_thisthread = 181, // expr_thisthread
|
||||
S_expr_empty_array = 182, // expr_empty_array
|
||||
S_expr_undefined = 183, // expr_undefined
|
||||
S_expr_game = 184, // expr_game
|
||||
S_expr_self = 185, // expr_self
|
||||
S_expr_anim = 186, // expr_anim
|
||||
S_expr_level = 187, // expr_level
|
||||
S_expr_animation = 188, // expr_animation
|
||||
S_expr_animtree = 189, // expr_animtree
|
||||
S_expr_identifier_neg = 190, // expr_identifier_neg
|
||||
S_expr_negate = 164, // expr_negate
|
||||
S_expr_not = 165, // expr_not
|
||||
S_expr_call = 166, // expr_call
|
||||
S_expr_method = 167, // expr_method
|
||||
S_expr_function = 168, // expr_function
|
||||
S_expr_pointer = 169, // expr_pointer
|
||||
S_expr_add_array = 170, // expr_add_array
|
||||
S_expr_parameters = 171, // expr_parameters
|
||||
S_expr_arguments = 172, // expr_arguments
|
||||
S_expr_arguments_no_empty = 173, // expr_arguments_no_empty
|
||||
S_expr_isdefined = 174, // expr_isdefined
|
||||
S_expr_istrue = 175, // expr_istrue
|
||||
S_expr_reference = 176, // expr_reference
|
||||
S_expr_array = 177, // expr_array
|
||||
S_expr_field = 178, // expr_field
|
||||
S_expr_size = 179, // expr_size
|
||||
S_expr_paren = 180, // expr_paren
|
||||
S_expr_object = 181, // expr_object
|
||||
S_expr_thisthread = 182, // expr_thisthread
|
||||
S_expr_empty_array = 183, // expr_empty_array
|
||||
S_expr_undefined = 184, // expr_undefined
|
||||
S_expr_game = 185, // expr_game
|
||||
S_expr_self = 186, // expr_self
|
||||
S_expr_anim = 187, // expr_anim
|
||||
S_expr_level = 188, // expr_level
|
||||
S_expr_animation = 189, // expr_animation
|
||||
S_expr_animtree = 190, // expr_animtree
|
||||
S_expr_identifier_nosize = 191, // expr_identifier_nosize
|
||||
S_expr_identifier = 192, // expr_identifier
|
||||
S_expr_path = 193, // expr_path
|
||||
@ -1097,7 +1099,6 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1183,6 +1184,10 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1750,6 +1755,20 @@ namespace xsk { namespace gsc { namespace iw8 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2406,7 +2425,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2492,6 +2510,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4903,7 +4925,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2360, ///< Last index in yytable_.
|
||||
yylast_ = 2481, ///< Last index in yytable_.
|
||||
yynnts_ = 86, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4961,7 +4983,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -5047,6 +5068,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5288,7 +5313,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5374,6 +5398,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5621,7 +5649,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::iw8
|
||||
#line 5625 "parser.hpp"
|
||||
#line 5653 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1259,6 +1262,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,134 +505,137 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy62[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -641,7 +643,7 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy67[sizeof (std::string)];
|
||||
char dummy68[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -984,31 +986,31 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
S_expr_binary = 159, // expr_binary
|
||||
S_expr_primitive = 160, // expr_primitive
|
||||
S_expr_complement = 161, // expr_complement
|
||||
S_expr_not = 162, // expr_not
|
||||
S_expr_call = 163, // expr_call
|
||||
S_expr_method = 164, // expr_method
|
||||
S_expr_function = 165, // expr_function
|
||||
S_expr_pointer = 166, // expr_pointer
|
||||
S_expr_add_array = 167, // expr_add_array
|
||||
S_expr_parameters = 168, // expr_parameters
|
||||
S_expr_arguments = 169, // expr_arguments
|
||||
S_expr_arguments_no_empty = 170, // expr_arguments_no_empty
|
||||
S_expr_reference = 171, // expr_reference
|
||||
S_expr_array = 172, // expr_array
|
||||
S_expr_field = 173, // expr_field
|
||||
S_expr_size = 174, // expr_size
|
||||
S_expr_paren = 175, // expr_paren
|
||||
S_expr_object = 176, // expr_object
|
||||
S_expr_thisthread = 177, // expr_thisthread
|
||||
S_expr_empty_array = 178, // expr_empty_array
|
||||
S_expr_undefined = 179, // expr_undefined
|
||||
S_expr_game = 180, // expr_game
|
||||
S_expr_self = 181, // expr_self
|
||||
S_expr_anim = 182, // expr_anim
|
||||
S_expr_level = 183, // expr_level
|
||||
S_expr_animation = 184, // expr_animation
|
||||
S_expr_animtree = 185, // expr_animtree
|
||||
S_expr_identifier_neg = 186, // expr_identifier_neg
|
||||
S_expr_negate = 162, // expr_negate
|
||||
S_expr_not = 163, // expr_not
|
||||
S_expr_call = 164, // expr_call
|
||||
S_expr_method = 165, // expr_method
|
||||
S_expr_function = 166, // expr_function
|
||||
S_expr_pointer = 167, // expr_pointer
|
||||
S_expr_add_array = 168, // expr_add_array
|
||||
S_expr_parameters = 169, // expr_parameters
|
||||
S_expr_arguments = 170, // expr_arguments
|
||||
S_expr_arguments_no_empty = 171, // expr_arguments_no_empty
|
||||
S_expr_reference = 172, // expr_reference
|
||||
S_expr_array = 173, // expr_array
|
||||
S_expr_field = 174, // expr_field
|
||||
S_expr_size = 175, // expr_size
|
||||
S_expr_paren = 176, // expr_paren
|
||||
S_expr_object = 177, // expr_object
|
||||
S_expr_thisthread = 178, // expr_thisthread
|
||||
S_expr_empty_array = 179, // expr_empty_array
|
||||
S_expr_undefined = 180, // expr_undefined
|
||||
S_expr_game = 181, // expr_game
|
||||
S_expr_self = 182, // expr_self
|
||||
S_expr_anim = 183, // expr_anim
|
||||
S_expr_level = 184, // expr_level
|
||||
S_expr_animation = 185, // expr_animation
|
||||
S_expr_animtree = 186, // expr_animtree
|
||||
S_expr_identifier_nosize = 187, // expr_identifier_nosize
|
||||
S_expr_identifier = 188, // expr_identifier
|
||||
S_expr_path = 189, // expr_path
|
||||
@ -1085,7 +1087,6 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1163,6 +1164,10 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1702,6 +1707,20 @@ namespace xsk { namespace gsc { namespace s1 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2358,7 +2377,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2436,6 +2454,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4817,7 +4839,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2310, ///< Last index in yytable_.
|
||||
yylast_ = 2419, ///< Last index in yytable_.
|
||||
yynnts_ = 84, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4875,7 +4897,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4953,6 +4974,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5194,7 +5219,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5272,6 +5296,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5519,7 +5547,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::s1
|
||||
#line 5523 "parser.hpp"
|
||||
#line 5551 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1259,6 +1262,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -506,134 +505,137 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
// expr_method
|
||||
char dummy24[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy25[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy25[sizeof (ast::expr_not::ptr)];
|
||||
char dummy26[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy26[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy27[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy27[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy28[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy28[sizeof (ast::expr_path::ptr)];
|
||||
char dummy29[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy29[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy30[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy30[sizeof (ast::expr_self::ptr)];
|
||||
char dummy31[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy31[sizeof (ast::expr_size::ptr)];
|
||||
char dummy32[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy32[sizeof (ast::expr_string::ptr)];
|
||||
char dummy33[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy33[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy34[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy34[sizeof (ast::expr_true::ptr)];
|
||||
char dummy35[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy35[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy36[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy36[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy37[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy37[sizeof (ast::include::ptr)];
|
||||
char dummy38[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy38[sizeof (ast::program::ptr)];
|
||||
char dummy39[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy39[sizeof (ast::stmt)];
|
||||
char dummy40[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy40[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy41[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy41[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy42[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy42[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy43[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy44[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy45[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy46[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy47[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy48[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy49[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy50[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy51[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy52[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy53[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy54[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy55[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy56[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy57[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy58[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy59[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy60[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy61[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy62[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy63[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy64[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy65[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy66[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -641,7 +643,7 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy67[sizeof (std::string)];
|
||||
char dummy68[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -984,31 +986,31 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
S_expr_binary = 159, // expr_binary
|
||||
S_expr_primitive = 160, // expr_primitive
|
||||
S_expr_complement = 161, // expr_complement
|
||||
S_expr_not = 162, // expr_not
|
||||
S_expr_call = 163, // expr_call
|
||||
S_expr_method = 164, // expr_method
|
||||
S_expr_function = 165, // expr_function
|
||||
S_expr_pointer = 166, // expr_pointer
|
||||
S_expr_add_array = 167, // expr_add_array
|
||||
S_expr_parameters = 168, // expr_parameters
|
||||
S_expr_arguments = 169, // expr_arguments
|
||||
S_expr_arguments_no_empty = 170, // expr_arguments_no_empty
|
||||
S_expr_reference = 171, // expr_reference
|
||||
S_expr_array = 172, // expr_array
|
||||
S_expr_field = 173, // expr_field
|
||||
S_expr_size = 174, // expr_size
|
||||
S_expr_paren = 175, // expr_paren
|
||||
S_expr_object = 176, // expr_object
|
||||
S_expr_thisthread = 177, // expr_thisthread
|
||||
S_expr_empty_array = 178, // expr_empty_array
|
||||
S_expr_undefined = 179, // expr_undefined
|
||||
S_expr_game = 180, // expr_game
|
||||
S_expr_self = 181, // expr_self
|
||||
S_expr_anim = 182, // expr_anim
|
||||
S_expr_level = 183, // expr_level
|
||||
S_expr_animation = 184, // expr_animation
|
||||
S_expr_animtree = 185, // expr_animtree
|
||||
S_expr_identifier_neg = 186, // expr_identifier_neg
|
||||
S_expr_negate = 162, // expr_negate
|
||||
S_expr_not = 163, // expr_not
|
||||
S_expr_call = 164, // expr_call
|
||||
S_expr_method = 165, // expr_method
|
||||
S_expr_function = 166, // expr_function
|
||||
S_expr_pointer = 167, // expr_pointer
|
||||
S_expr_add_array = 168, // expr_add_array
|
||||
S_expr_parameters = 169, // expr_parameters
|
||||
S_expr_arguments = 170, // expr_arguments
|
||||
S_expr_arguments_no_empty = 171, // expr_arguments_no_empty
|
||||
S_expr_reference = 172, // expr_reference
|
||||
S_expr_array = 173, // expr_array
|
||||
S_expr_field = 174, // expr_field
|
||||
S_expr_size = 175, // expr_size
|
||||
S_expr_paren = 176, // expr_paren
|
||||
S_expr_object = 177, // expr_object
|
||||
S_expr_thisthread = 178, // expr_thisthread
|
||||
S_expr_empty_array = 179, // expr_empty_array
|
||||
S_expr_undefined = 180, // expr_undefined
|
||||
S_expr_game = 181, // expr_game
|
||||
S_expr_self = 182, // expr_self
|
||||
S_expr_anim = 183, // expr_anim
|
||||
S_expr_level = 184, // expr_level
|
||||
S_expr_animation = 185, // expr_animation
|
||||
S_expr_animtree = 186, // expr_animtree
|
||||
S_expr_identifier_nosize = 187, // expr_identifier_nosize
|
||||
S_expr_identifier = 188, // expr_identifier
|
||||
S_expr_path = 189, // expr_path
|
||||
@ -1085,7 +1087,6 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1163,6 +1164,10 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1702,6 +1707,20 @@ namespace xsk { namespace gsc { namespace s2 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2358,7 +2377,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2436,6 +2454,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4817,7 +4839,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2310, ///< Last index in yytable_.
|
||||
yylast_ = 2419, ///< Last index in yytable_.
|
||||
yynnts_ = 84, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4875,7 +4897,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -4953,6 +4974,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5194,7 +5219,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5272,6 +5296,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5519,7 +5547,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::s2
|
||||
#line 5523 "parser.hpp"
|
||||
#line 5551 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -946,6 +946,9 @@ void compiler::emit_expr(const ast::expr& expr, const block::ptr& blk)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement, blk);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate, blk);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not, blk);
|
||||
break;
|
||||
@ -1283,6 +1286,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr, const
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue, blk);
|
||||
emit_opcode(opcode::OP_minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk)
|
||||
{
|
||||
emit_expr(expr->rvalue, blk);
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr, const block::ptr& blk);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, const block::ptr& blk, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_add_array
|
||||
@ -512,134 +511,137 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
// expr_method
|
||||
char dummy26[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy27[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy27[sizeof (ast::expr_not::ptr)];
|
||||
char dummy28[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy28[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy29[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy29[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy30[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy30[sizeof (ast::expr_path::ptr)];
|
||||
char dummy31[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy31[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy32[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy32[sizeof (ast::expr_self::ptr)];
|
||||
char dummy33[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy33[sizeof (ast::expr_size::ptr)];
|
||||
char dummy34[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy34[sizeof (ast::expr_string::ptr)];
|
||||
char dummy35[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_thisthread
|
||||
char dummy35[sizeof (ast::expr_thisthread::ptr)];
|
||||
char dummy36[sizeof (ast::expr_thisthread::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy36[sizeof (ast::expr_true::ptr)];
|
||||
char dummy37[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy37[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy38[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy38[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy39[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// include
|
||||
char dummy39[sizeof (ast::include::ptr)];
|
||||
char dummy40[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy40[sizeof (ast::program::ptr)];
|
||||
char dummy41[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy41[sizeof (ast::stmt)];
|
||||
char dummy42[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy42[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy43[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy43[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy44[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_breakpoint
|
||||
char dummy44[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
char dummy45[sizeof (ast::stmt_breakpoint::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy45[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy46[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy46[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy47[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy47[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy48[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy48[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy49[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy49[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy50[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy50[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy51[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy51[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy52[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy52[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy53[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy53[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy54[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy54[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy55[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy55[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy56[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy56[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy57[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy57[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy58[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy59[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy60[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy61[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy62[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy63[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waitframe
|
||||
char dummy64[sizeof (ast::stmt_waitframe::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_waitframe::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy65[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy66[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy67[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy68[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy68[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy69[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -647,7 +649,7 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
// "localized string"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy69[sizeof (std::string)];
|
||||
char dummy70[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -994,33 +996,33 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
S_expr_binary = 161, // expr_binary
|
||||
S_expr_primitive = 162, // expr_primitive
|
||||
S_expr_complement = 163, // expr_complement
|
||||
S_expr_not = 164, // expr_not
|
||||
S_expr_call = 165, // expr_call
|
||||
S_expr_method = 166, // expr_method
|
||||
S_expr_function = 167, // expr_function
|
||||
S_expr_pointer = 168, // expr_pointer
|
||||
S_expr_add_array = 169, // expr_add_array
|
||||
S_expr_parameters = 170, // expr_parameters
|
||||
S_expr_arguments = 171, // expr_arguments
|
||||
S_expr_arguments_no_empty = 172, // expr_arguments_no_empty
|
||||
S_expr_isdefined = 173, // expr_isdefined
|
||||
S_expr_istrue = 174, // expr_istrue
|
||||
S_expr_reference = 175, // expr_reference
|
||||
S_expr_array = 176, // expr_array
|
||||
S_expr_field = 177, // expr_field
|
||||
S_expr_size = 178, // expr_size
|
||||
S_expr_paren = 179, // expr_paren
|
||||
S_expr_object = 180, // expr_object
|
||||
S_expr_thisthread = 181, // expr_thisthread
|
||||
S_expr_empty_array = 182, // expr_empty_array
|
||||
S_expr_undefined = 183, // expr_undefined
|
||||
S_expr_game = 184, // expr_game
|
||||
S_expr_self = 185, // expr_self
|
||||
S_expr_anim = 186, // expr_anim
|
||||
S_expr_level = 187, // expr_level
|
||||
S_expr_animation = 188, // expr_animation
|
||||
S_expr_animtree = 189, // expr_animtree
|
||||
S_expr_identifier_neg = 190, // expr_identifier_neg
|
||||
S_expr_negate = 164, // expr_negate
|
||||
S_expr_not = 165, // expr_not
|
||||
S_expr_call = 166, // expr_call
|
||||
S_expr_method = 167, // expr_method
|
||||
S_expr_function = 168, // expr_function
|
||||
S_expr_pointer = 169, // expr_pointer
|
||||
S_expr_add_array = 170, // expr_add_array
|
||||
S_expr_parameters = 171, // expr_parameters
|
||||
S_expr_arguments = 172, // expr_arguments
|
||||
S_expr_arguments_no_empty = 173, // expr_arguments_no_empty
|
||||
S_expr_isdefined = 174, // expr_isdefined
|
||||
S_expr_istrue = 175, // expr_istrue
|
||||
S_expr_reference = 176, // expr_reference
|
||||
S_expr_array = 177, // expr_array
|
||||
S_expr_field = 178, // expr_field
|
||||
S_expr_size = 179, // expr_size
|
||||
S_expr_paren = 180, // expr_paren
|
||||
S_expr_object = 181, // expr_object
|
||||
S_expr_thisthread = 182, // expr_thisthread
|
||||
S_expr_empty_array = 183, // expr_empty_array
|
||||
S_expr_undefined = 184, // expr_undefined
|
||||
S_expr_game = 185, // expr_game
|
||||
S_expr_self = 186, // expr_self
|
||||
S_expr_anim = 187, // expr_anim
|
||||
S_expr_level = 188, // expr_level
|
||||
S_expr_animation = 189, // expr_animation
|
||||
S_expr_animtree = 190, // expr_animtree
|
||||
S_expr_identifier_nosize = 191, // expr_identifier_nosize
|
||||
S_expr_identifier = 192, // expr_identifier
|
||||
S_expr_path = 193, // expr_path
|
||||
@ -1097,7 +1099,6 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1183,6 +1184,10 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -1750,6 +1755,20 @@ namespace xsk { namespace gsc { namespace s4 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2406,7 +2425,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2492,6 +2510,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -4903,7 +4925,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 2360, ///< Last index in yytable_.
|
||||
yylast_ = 2481, ///< Last index in yytable_.
|
||||
yynnts_ = 86, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -4961,7 +4983,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -5047,6 +5068,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5288,7 +5313,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -5374,6 +5398,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -5621,7 +5649,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::gsc::s4
|
||||
#line 5625 "parser.hpp"
|
||||
#line 5653 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -813,6 +813,9 @@ void compiler::emit_expr(const ast::expr& expr)
|
||||
case ast::kind::expr_complement:
|
||||
emit_expr_complement(expr.as_complement);
|
||||
break;
|
||||
case ast::kind::expr_negate:
|
||||
emit_expr_negate(expr.as_negate);
|
||||
break;
|
||||
case ast::kind::expr_not:
|
||||
emit_expr_not(expr.as_not);
|
||||
break;
|
||||
@ -1163,6 +1166,13 @@ void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr)
|
||||
emit_opcode(opcode::OP_BoolComplement);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr)
|
||||
{
|
||||
emit_opcode(opcode::OP_GetZero);
|
||||
emit_expr(expr->rvalue);
|
||||
emit_opcode(opcode::OP_Minus);
|
||||
}
|
||||
|
||||
void compiler::emit_expr_not(const ast::expr_not::ptr& expr)
|
||||
{
|
||||
emit_expr(expr->rvalue);
|
||||
|
@ -80,6 +80,7 @@ private:
|
||||
void emit_expr_and(const ast::expr_and::ptr& expr);
|
||||
void emit_expr_or(const ast::expr_or::ptr& expr);
|
||||
void emit_expr_complement(const ast::expr_complement::ptr& expr);
|
||||
void emit_expr_negate(const ast::expr_negate::ptr& expr);
|
||||
void emit_expr_not(const ast::expr_not::ptr& expr);
|
||||
void emit_expr_call(const ast::expr_call::ptr& expr, bool is_stmt);
|
||||
void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, bool is_stmt);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -447,7 +447,6 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
// expr_binary
|
||||
// expr_primitive
|
||||
// expr_object
|
||||
// expr_identifier_neg
|
||||
char dummy6[sizeof (ast::expr)];
|
||||
|
||||
// expr_abs
|
||||
@ -554,131 +553,134 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
// expr_method
|
||||
char dummy40[sizeof (ast::expr_method::ptr)];
|
||||
|
||||
// expr_negate
|
||||
char dummy41[sizeof (ast::expr_negate::ptr)];
|
||||
|
||||
// expr_not
|
||||
char dummy41[sizeof (ast::expr_not::ptr)];
|
||||
char dummy42[sizeof (ast::expr_not::ptr)];
|
||||
|
||||
// expr_parameters
|
||||
char dummy42[sizeof (ast::expr_parameters::ptr)];
|
||||
char dummy43[sizeof (ast::expr_parameters::ptr)];
|
||||
|
||||
// expr_paren
|
||||
char dummy43[sizeof (ast::expr_paren::ptr)];
|
||||
char dummy44[sizeof (ast::expr_paren::ptr)];
|
||||
|
||||
// expr_path
|
||||
char dummy44[sizeof (ast::expr_path::ptr)];
|
||||
char dummy45[sizeof (ast::expr_path::ptr)];
|
||||
|
||||
// expr_reference
|
||||
char dummy45[sizeof (ast::expr_reference::ptr)];
|
||||
char dummy46[sizeof (ast::expr_reference::ptr)];
|
||||
|
||||
// expr_self
|
||||
char dummy46[sizeof (ast::expr_self::ptr)];
|
||||
char dummy47[sizeof (ast::expr_self::ptr)];
|
||||
|
||||
// expr_size
|
||||
char dummy47[sizeof (ast::expr_size::ptr)];
|
||||
char dummy48[sizeof (ast::expr_size::ptr)];
|
||||
|
||||
// expr_string
|
||||
char dummy48[sizeof (ast::expr_string::ptr)];
|
||||
char dummy49[sizeof (ast::expr_string::ptr)];
|
||||
|
||||
// expr_true
|
||||
char dummy49[sizeof (ast::expr_true::ptr)];
|
||||
char dummy50[sizeof (ast::expr_true::ptr)];
|
||||
|
||||
// expr_undefined
|
||||
char dummy50[sizeof (ast::expr_undefined::ptr)];
|
||||
char dummy51[sizeof (ast::expr_undefined::ptr)];
|
||||
|
||||
// expr_vector
|
||||
char dummy51[sizeof (ast::expr_vector::ptr)];
|
||||
char dummy52[sizeof (ast::expr_vector::ptr)];
|
||||
|
||||
// expr_vectorscale
|
||||
char dummy52[sizeof (ast::expr_vectorscale::ptr)];
|
||||
char dummy53[sizeof (ast::expr_vectorscale::ptr)];
|
||||
|
||||
// expr_vectortoangles
|
||||
char dummy53[sizeof (ast::expr_vectortoangles::ptr)];
|
||||
char dummy54[sizeof (ast::expr_vectortoangles::ptr)];
|
||||
|
||||
// include
|
||||
char dummy54[sizeof (ast::include::ptr)];
|
||||
char dummy55[sizeof (ast::include::ptr)];
|
||||
|
||||
// program
|
||||
char dummy55[sizeof (ast::program::ptr)];
|
||||
char dummy56[sizeof (ast::program::ptr)];
|
||||
|
||||
// stmt
|
||||
// stmt_or_dev
|
||||
char dummy56[sizeof (ast::stmt)];
|
||||
char dummy57[sizeof (ast::stmt)];
|
||||
|
||||
// stmt_assign
|
||||
char dummy57[sizeof (ast::stmt_assign::ptr)];
|
||||
char dummy58[sizeof (ast::stmt_assign::ptr)];
|
||||
|
||||
// stmt_break
|
||||
char dummy58[sizeof (ast::stmt_break::ptr)];
|
||||
char dummy59[sizeof (ast::stmt_break::ptr)];
|
||||
|
||||
// stmt_call
|
||||
char dummy59[sizeof (ast::stmt_call::ptr)];
|
||||
char dummy60[sizeof (ast::stmt_call::ptr)];
|
||||
|
||||
// stmt_case
|
||||
char dummy60[sizeof (ast::stmt_case::ptr)];
|
||||
char dummy61[sizeof (ast::stmt_case::ptr)];
|
||||
|
||||
// stmt_continue
|
||||
char dummy61[sizeof (ast::stmt_continue::ptr)];
|
||||
char dummy62[sizeof (ast::stmt_continue::ptr)];
|
||||
|
||||
// stmt_default
|
||||
char dummy62[sizeof (ast::stmt_default::ptr)];
|
||||
char dummy63[sizeof (ast::stmt_default::ptr)];
|
||||
|
||||
// stmt_dev
|
||||
char dummy63[sizeof (ast::stmt_dev::ptr)];
|
||||
char dummy64[sizeof (ast::stmt_dev::ptr)];
|
||||
|
||||
// stmt_dowhile
|
||||
char dummy64[sizeof (ast::stmt_dowhile::ptr)];
|
||||
char dummy65[sizeof (ast::stmt_dowhile::ptr)];
|
||||
|
||||
// stmt_endon
|
||||
char dummy65[sizeof (ast::stmt_endon::ptr)];
|
||||
char dummy66[sizeof (ast::stmt_endon::ptr)];
|
||||
|
||||
// stmt_expr
|
||||
char dummy66[sizeof (ast::stmt_expr::ptr)];
|
||||
char dummy67[sizeof (ast::stmt_expr::ptr)];
|
||||
|
||||
// stmt_for
|
||||
char dummy67[sizeof (ast::stmt_for::ptr)];
|
||||
char dummy68[sizeof (ast::stmt_for::ptr)];
|
||||
|
||||
// stmt_foreach
|
||||
char dummy68[sizeof (ast::stmt_foreach::ptr)];
|
||||
char dummy69[sizeof (ast::stmt_foreach::ptr)];
|
||||
|
||||
// stmt_if
|
||||
char dummy69[sizeof (ast::stmt_if::ptr)];
|
||||
char dummy70[sizeof (ast::stmt_if::ptr)];
|
||||
|
||||
// stmt_ifelse
|
||||
char dummy70[sizeof (ast::stmt_ifelse::ptr)];
|
||||
char dummy71[sizeof (ast::stmt_ifelse::ptr)];
|
||||
|
||||
// stmt_list
|
||||
// stmt_or_dev_list
|
||||
// stmt_block
|
||||
char dummy71[sizeof (ast::stmt_list::ptr)];
|
||||
char dummy72[sizeof (ast::stmt_list::ptr)];
|
||||
|
||||
// stmt_notify
|
||||
char dummy72[sizeof (ast::stmt_notify::ptr)];
|
||||
char dummy73[sizeof (ast::stmt_notify::ptr)];
|
||||
|
||||
// stmt_prof_begin
|
||||
char dummy73[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
char dummy74[sizeof (ast::stmt_prof_begin::ptr)];
|
||||
|
||||
// stmt_prof_end
|
||||
char dummy74[sizeof (ast::stmt_prof_end::ptr)];
|
||||
char dummy75[sizeof (ast::stmt_prof_end::ptr)];
|
||||
|
||||
// stmt_return
|
||||
char dummy75[sizeof (ast::stmt_return::ptr)];
|
||||
char dummy76[sizeof (ast::stmt_return::ptr)];
|
||||
|
||||
// stmt_switch
|
||||
char dummy76[sizeof (ast::stmt_switch::ptr)];
|
||||
char dummy77[sizeof (ast::stmt_switch::ptr)];
|
||||
|
||||
// stmt_wait
|
||||
char dummy77[sizeof (ast::stmt_wait::ptr)];
|
||||
char dummy78[sizeof (ast::stmt_wait::ptr)];
|
||||
|
||||
// stmt_waittill
|
||||
char dummy78[sizeof (ast::stmt_waittill::ptr)];
|
||||
char dummy79[sizeof (ast::stmt_waittill::ptr)];
|
||||
|
||||
// stmt_waittillframeend
|
||||
char dummy79[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
char dummy80[sizeof (ast::stmt_waittillframeend::ptr)];
|
||||
|
||||
// stmt_waittillmatch
|
||||
char dummy80[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
char dummy81[sizeof (ast::stmt_waittillmatch::ptr)];
|
||||
|
||||
// stmt_while
|
||||
char dummy81[sizeof (ast::stmt_while::ptr)];
|
||||
char dummy82[sizeof (ast::stmt_while::ptr)];
|
||||
|
||||
// "path"
|
||||
// "identifier"
|
||||
@ -687,7 +689,7 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
// "hash"
|
||||
// "float"
|
||||
// "integer"
|
||||
char dummy82[sizeof (std::string)];
|
||||
char dummy83[sizeof (std::string)];
|
||||
};
|
||||
|
||||
/// The size of the largest semantic type.
|
||||
@ -1054,47 +1056,47 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
S_expr_binary = 170, // expr_binary
|
||||
S_expr_primitive = 171, // expr_primitive
|
||||
S_expr_complement = 172, // expr_complement
|
||||
S_expr_not = 173, // expr_not
|
||||
S_expr_call = 174, // expr_call
|
||||
S_expr_method = 175, // expr_method
|
||||
S_expr_function = 176, // expr_function
|
||||
S_expr_pointer = 177, // expr_pointer
|
||||
S_expr_parameters = 178, // expr_parameters
|
||||
S_expr_arguments = 179, // expr_arguments
|
||||
S_expr_arguments_no_empty = 180, // expr_arguments_no_empty
|
||||
S_expr_getnextarraykey = 181, // expr_getnextarraykey
|
||||
S_expr_getfirstarraykey = 182, // expr_getfirstarraykey
|
||||
S_expr_getdvarcoloralpha = 183, // expr_getdvarcoloralpha
|
||||
S_expr_getdvarcolorblue = 184, // expr_getdvarcolorblue
|
||||
S_expr_getdvarcolorgreen = 185, // expr_getdvarcolorgreen
|
||||
S_expr_getdvarcolorred = 186, // expr_getdvarcolorred
|
||||
S_expr_getdvarvector = 187, // expr_getdvarvector
|
||||
S_expr_getdvarfloat = 188, // expr_getdvarfloat
|
||||
S_expr_getdvarint = 189, // expr_getdvarint
|
||||
S_expr_getdvar = 190, // expr_getdvar
|
||||
S_expr_gettime = 191, // expr_gettime
|
||||
S_expr_abs = 192, // expr_abs
|
||||
S_expr_vectortoangles = 193, // expr_vectortoangles
|
||||
S_expr_angleclamp180 = 194, // expr_angleclamp180
|
||||
S_expr_anglestoforward = 195, // expr_anglestoforward
|
||||
S_expr_anglestoright = 196, // expr_anglestoright
|
||||
S_expr_anglestoup = 197, // expr_anglestoup
|
||||
S_expr_vectorscale = 198, // expr_vectorscale
|
||||
S_expr_isdefined = 199, // expr_isdefined
|
||||
S_expr_reference = 200, // expr_reference
|
||||
S_expr_array = 201, // expr_array
|
||||
S_expr_field = 202, // expr_field
|
||||
S_expr_size = 203, // expr_size
|
||||
S_expr_paren = 204, // expr_paren
|
||||
S_expr_object = 205, // expr_object
|
||||
S_expr_empty_array = 206, // expr_empty_array
|
||||
S_expr_undefined = 207, // expr_undefined
|
||||
S_expr_game = 208, // expr_game
|
||||
S_expr_self = 209, // expr_self
|
||||
S_expr_anim = 210, // expr_anim
|
||||
S_expr_level = 211, // expr_level
|
||||
S_expr_animation = 212, // expr_animation
|
||||
S_expr_identifier_neg = 213, // expr_identifier_neg
|
||||
S_expr_negate = 173, // expr_negate
|
||||
S_expr_not = 174, // expr_not
|
||||
S_expr_call = 175, // expr_call
|
||||
S_expr_method = 176, // expr_method
|
||||
S_expr_function = 177, // expr_function
|
||||
S_expr_pointer = 178, // expr_pointer
|
||||
S_expr_parameters = 179, // expr_parameters
|
||||
S_expr_arguments = 180, // expr_arguments
|
||||
S_expr_arguments_no_empty = 181, // expr_arguments_no_empty
|
||||
S_expr_getnextarraykey = 182, // expr_getnextarraykey
|
||||
S_expr_getfirstarraykey = 183, // expr_getfirstarraykey
|
||||
S_expr_getdvarcoloralpha = 184, // expr_getdvarcoloralpha
|
||||
S_expr_getdvarcolorblue = 185, // expr_getdvarcolorblue
|
||||
S_expr_getdvarcolorgreen = 186, // expr_getdvarcolorgreen
|
||||
S_expr_getdvarcolorred = 187, // expr_getdvarcolorred
|
||||
S_expr_getdvarvector = 188, // expr_getdvarvector
|
||||
S_expr_getdvarfloat = 189, // expr_getdvarfloat
|
||||
S_expr_getdvarint = 190, // expr_getdvarint
|
||||
S_expr_getdvar = 191, // expr_getdvar
|
||||
S_expr_gettime = 192, // expr_gettime
|
||||
S_expr_abs = 193, // expr_abs
|
||||
S_expr_vectortoangles = 194, // expr_vectortoangles
|
||||
S_expr_angleclamp180 = 195, // expr_angleclamp180
|
||||
S_expr_anglestoforward = 196, // expr_anglestoforward
|
||||
S_expr_anglestoright = 197, // expr_anglestoright
|
||||
S_expr_anglestoup = 198, // expr_anglestoup
|
||||
S_expr_vectorscale = 199, // expr_vectorscale
|
||||
S_expr_isdefined = 200, // expr_isdefined
|
||||
S_expr_reference = 201, // expr_reference
|
||||
S_expr_array = 202, // expr_array
|
||||
S_expr_field = 203, // expr_field
|
||||
S_expr_size = 204, // expr_size
|
||||
S_expr_paren = 205, // expr_paren
|
||||
S_expr_object = 206, // expr_object
|
||||
S_expr_empty_array = 207, // expr_empty_array
|
||||
S_expr_undefined = 208, // expr_undefined
|
||||
S_expr_game = 209, // expr_game
|
||||
S_expr_self = 210, // expr_self
|
||||
S_expr_anim = 211, // expr_anim
|
||||
S_expr_level = 212, // expr_level
|
||||
S_expr_animation = 213, // expr_animation
|
||||
S_expr_identifier_nosize = 214, // expr_identifier_nosize
|
||||
S_expr_identifier = 215, // expr_identifier
|
||||
S_expr_path = 216, // expr_path
|
||||
@ -1172,7 +1174,6 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
@ -1314,6 +1315,10 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
value.move< ast::expr_method::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (std::move (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (std::move (that.value));
|
||||
break;
|
||||
@ -2074,6 +2079,20 @@ namespace xsk { namespace arc { namespace t6 {
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
, value (std::move (v))
|
||||
, location (std::move (l))
|
||||
{}
|
||||
#else
|
||||
basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l)
|
||||
: Base (t)
|
||||
, value (v)
|
||||
, location (l)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if 201103L <= YY_CPLUSPLUS
|
||||
basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l)
|
||||
: Base (t)
|
||||
@ -2716,7 +2735,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.template destroy< ast::expr > ();
|
||||
break;
|
||||
|
||||
@ -2858,6 +2876,10 @@ switch (yykind)
|
||||
value.template destroy< ast::expr_method::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.template destroy< ast::expr_negate::ptr > ();
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.template destroy< ast::expr_not::ptr > ();
|
||||
break;
|
||||
@ -5167,7 +5189,7 @@ switch (yykind)
|
||||
// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
|
||||
// Performed when YYTABLE does not specify something else to do. Zero
|
||||
// means the default is an error.
|
||||
static const unsigned char yydefact_[];
|
||||
static const short yydefact_[];
|
||||
|
||||
// YYPGOTO[NTERM-NUM].
|
||||
static const short yypgoto_[];
|
||||
@ -5431,7 +5453,7 @@ switch (yykind)
|
||||
/// Constants.
|
||||
enum
|
||||
{
|
||||
yylast_ = 3494, ///< Last index in yytable_.
|
||||
yylast_ = 3562, ///< Last index in yytable_.
|
||||
yynnts_ = 99, ///< Number of nonterminal symbols.
|
||||
yyfinal_ = 22 ///< Termination state number.
|
||||
};
|
||||
@ -5489,7 +5511,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.copy< ast::expr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
@ -5631,6 +5652,10 @@ switch (yykind)
|
||||
value.copy< ast::expr_method::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.copy< ast::expr_not::ptr > (YY_MOVE (that.value));
|
||||
break;
|
||||
@ -5869,7 +5894,6 @@ switch (yykind)
|
||||
case symbol_kind::S_expr_binary: // expr_binary
|
||||
case symbol_kind::S_expr_primitive: // expr_primitive
|
||||
case symbol_kind::S_expr_object: // expr_object
|
||||
case symbol_kind::S_expr_identifier_neg: // expr_identifier_neg
|
||||
value.move< ast::expr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
@ -6011,6 +6035,10 @@ switch (yykind)
|
||||
value.move< ast::expr_method::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_negate: // expr_negate
|
||||
value.move< ast::expr_negate::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
|
||||
case symbol_kind::S_expr_not: // expr_not
|
||||
value.move< ast::expr_not::ptr > (YY_MOVE (s.value));
|
||||
break;
|
||||
@ -6255,7 +6283,7 @@ switch (yykind)
|
||||
|
||||
#line 13 "parser.ypp"
|
||||
} } } // xsk::arc::t6
|
||||
#line 6259 "parser.hpp"
|
||||
#line 6287 "parser.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -292,6 +292,9 @@ expr_call::expr_call(const location& loc, ast::call call) : node(kind::expr_call
|
||||
expr_complement::expr_complement(expr rvalue) : node(kind::expr_complement), rvalue(std::move(rvalue)) {}
|
||||
expr_complement::expr_complement(const location& loc, expr rvalue) : node(kind::expr_complement, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
expr_negate::expr_negate(expr rvalue) : node(kind::expr_negate), rvalue(std::move(rvalue)) {}
|
||||
expr_negate::expr_negate(const location& loc, expr rvalue) : node(kind::expr_negate, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
expr_not::expr_not(expr rvalue) : node(kind::expr_not), rvalue(std::move(rvalue)) {}
|
||||
expr_not::expr_not(const location& loc, expr rvalue) : node(kind::expr_not, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
@ -806,6 +809,11 @@ auto expr_complement::print() const -> std::string
|
||||
return "~" + rvalue.print();
|
||||
}
|
||||
|
||||
auto expr_negate::print() const -> std::string
|
||||
{
|
||||
return "-" + rvalue.print();
|
||||
}
|
||||
|
||||
auto expr_not::print() const -> std::string
|
||||
{
|
||||
return "!" + rvalue.print();
|
||||
@ -1694,6 +1702,7 @@ expr::~expr()
|
||||
case kind::expr_method: as_method.~unique_ptr(); return;
|
||||
case kind::expr_call: as_call.~unique_ptr(); return;
|
||||
case kind::expr_complement: as_complement.~unique_ptr(); return;
|
||||
case kind::expr_negate: as_negate.~unique_ptr(); return;
|
||||
case kind::expr_not: as_not.~unique_ptr(); return;
|
||||
case kind::expr_add: as_add.~unique_ptr(); return;
|
||||
case kind::expr_sub: as_sub.~unique_ptr(); return;
|
||||
|
@ -59,6 +59,7 @@ enum class kind
|
||||
expr_method,
|
||||
expr_call,
|
||||
expr_complement,
|
||||
expr_negate,
|
||||
expr_not,
|
||||
expr_add,
|
||||
expr_sub,
|
||||
@ -189,6 +190,7 @@ struct expr_function;
|
||||
struct expr_method;
|
||||
struct expr_call;
|
||||
struct expr_complement;
|
||||
struct expr_negate;
|
||||
struct expr_not;
|
||||
struct expr_binary;
|
||||
struct expr_add;
|
||||
@ -341,6 +343,7 @@ union expr
|
||||
std::unique_ptr<expr_method> as_method;
|
||||
std::unique_ptr<expr_call> as_call;
|
||||
std::unique_ptr<expr_complement> as_complement;
|
||||
std::unique_ptr<expr_negate> as_negate;
|
||||
std::unique_ptr<expr_not> as_not;
|
||||
std::unique_ptr<expr_binary> as_binary;
|
||||
std::unique_ptr<expr_add> as_add;
|
||||
@ -1051,6 +1054,17 @@ struct expr_complement : public node
|
||||
auto print() const -> std::string override;
|
||||
};
|
||||
|
||||
struct expr_negate : public node
|
||||
{
|
||||
using ptr = std::unique_ptr<expr_negate>;
|
||||
|
||||
expr rvalue;
|
||||
|
||||
expr_negate(expr rvalue);
|
||||
expr_negate(const location& loc, expr rvalue);
|
||||
auto print() const -> std::string override;
|
||||
};
|
||||
|
||||
struct expr_not : public node
|
||||
{
|
||||
using ptr = std::unique_ptr<expr_not>;
|
||||
|
@ -239,6 +239,9 @@ expr_call::expr_call(const location& loc, ast::call call) : node(kind::expr_call
|
||||
expr_complement::expr_complement(expr rvalue) : node(kind::expr_complement), rvalue(std::move(rvalue)) {}
|
||||
expr_complement::expr_complement(const location& loc, expr rvalue) : node(kind::expr_complement, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
expr_negate::expr_negate(expr rvalue) : node(kind::expr_negate), rvalue(std::move(rvalue)) {}
|
||||
expr_negate::expr_negate(const location& loc, expr rvalue) : node(kind::expr_negate, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
expr_not::expr_not(expr rvalue) : node(kind::expr_not), rvalue(std::move(rvalue)) {}
|
||||
expr_not::expr_not(const location& loc, expr rvalue) : node(kind::expr_not, loc), rvalue(std::move(rvalue)) {}
|
||||
|
||||
@ -693,6 +696,11 @@ auto expr_complement::print() const -> std::string
|
||||
return "~" + rvalue.print();
|
||||
}
|
||||
|
||||
auto expr_negate::print() const -> std::string
|
||||
{
|
||||
return "-" + rvalue.print();
|
||||
}
|
||||
|
||||
auto expr_not::print() const -> std::string
|
||||
{
|
||||
return "!" + rvalue.print();
|
||||
@ -1577,6 +1585,7 @@ expr::~expr()
|
||||
case kind::expr_method: as_method.~unique_ptr(); return;
|
||||
case kind::expr_call: as_call.~unique_ptr(); return;
|
||||
case kind::expr_complement: as_complement.~unique_ptr(); return;
|
||||
case kind::expr_negate: as_negate.~unique_ptr(); return;
|
||||
case kind::expr_not: as_not.~unique_ptr(); return;
|
||||
case kind::expr_add: as_add.~unique_ptr(); return;
|
||||
case kind::expr_sub: as_sub.~unique_ptr(); return;
|
||||
|
@ -44,6 +44,7 @@ enum class kind
|
||||
expr_method,
|
||||
expr_call,
|
||||
expr_complement,
|
||||
expr_negate,
|
||||
expr_not,
|
||||
expr_add,
|
||||
expr_sub,
|
||||
@ -162,6 +163,7 @@ struct expr_function;
|
||||
struct expr_method;
|
||||
struct expr_call;
|
||||
struct expr_complement;
|
||||
struct expr_negate;
|
||||
struct expr_not;
|
||||
struct expr_binary;
|
||||
struct expr_add;
|
||||
@ -301,6 +303,7 @@ union expr
|
||||
std::unique_ptr<expr_method> as_method;
|
||||
std::unique_ptr<expr_call> as_call;
|
||||
std::unique_ptr<expr_complement> as_complement;
|
||||
std::unique_ptr<expr_negate> as_negate;
|
||||
std::unique_ptr<expr_not> as_not;
|
||||
std::unique_ptr<expr_binary> as_binary;
|
||||
std::unique_ptr<expr_add> as_add;
|
||||
@ -843,6 +846,17 @@ struct expr_complement : public node
|
||||
auto print() const -> std::string override;
|
||||
};
|
||||
|
||||
struct expr_negate : public node
|
||||
{
|
||||
using ptr = std::unique_ptr<expr_negate>;
|
||||
|
||||
expr rvalue;
|
||||
|
||||
expr_negate(expr rvalue);
|
||||
expr_negate(const location& loc, expr rvalue);
|
||||
auto print() const -> std::string override;
|
||||
};
|
||||
|
||||
struct expr_not : public node
|
||||
{
|
||||
using ptr = std::unique_ptr<expr_not>;
|
||||
|
Loading…
Reference in New Issue
Block a user