1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

no need for SEP now that types are wrapped

This commit is contained in:
Kevin Glynn 2010-11-24 11:29:30 +01:00
parent 80d4d0685d
commit f3e1ca6e0b
4 changed files with 9 additions and 5 deletions

View File

@ -495,7 +495,7 @@ unary_expression:
;
cast_expression:
//'(' type ')' unary_expression ;
'(' type ')' unary_expression -> ^(CAST_EXPR type SEP unary_expression);
'(' type ')' unary_expression -> ^(CAST_EXPR type unary_expression);
assignment_operator:
'=' | '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>' '>=' ;
pre_increment_expression:
@ -533,8 +533,8 @@ relational_expression:
| (i='is' t=non_nullable_type -> ^(INSTANCEOF[$i.Token,"instanceof"] $relational_expression $t)
| i1='as' t1=non_nullable_type -> ^(COND_EXPR[$i1.Token, "?:"]
^(INSTANCEOF[$i1.Token,"instanceof"] { (CommonTree)adaptor.DupTree($relational_expression.tree) } { (CommonTree)adaptor.DupTree($t1.tree) } )
^(CAST_EXPR[$i1.Token, "(cast)"] { (CommonTree)adaptor.DupTree($t1.tree) } SEP[$i1.Token, "SEP"] { (CommonTree)adaptor.DupTree($relational_expression.tree) })
^(CAST_EXPR[$i1.Token, "(cast)"] { (CommonTree)adaptor.DupTree($t1.tree) } SEP[$i1.Token, "SEP"] NULL[$i1.Token, "null"])))
^(CAST_EXPR[$i1.Token, "(cast)"] { (CommonTree)adaptor.DupTree($t1.tree) } { (CommonTree)adaptor.DupTree($relational_expression.tree) })
^(CAST_EXPR[$i1.Token, "(cast)"] { (CommonTree)adaptor.DupTree($t1.tree) } NULL[$i1.Token, "null"])))
)* ;
equality_expression:
relational_expression

View File

@ -403,7 +403,7 @@ unary_expression:
| addressof_expression
;
cast_expression:
'(' type ')' unary_expression ;
^(CAST_EXPR type unary_expression ) -> cast_expr(type= { $type.st}, exp = { $unary_expression.st});
assignment_operator:
'=' | '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>' '>=' ;
pre_increment_expression:

View File

@ -329,7 +329,7 @@ unary_expression:
//('(' arguments ')' ('[' | '.' | '(')) => primary_or_array_creation_expression
//(cast_expression) => cast_expression
^(CAST_EXPR type SEP unary_expression)
^(CAST_EXPR type unary_expression)
| primary_or_array_creation_expression
| '+' unary_expression
| '-' unary_expression

View File

@ -86,5 +86,9 @@ modifiers(mods) ::= "<if(mods)><mods; separator=\" \"> <endif>"
extends(types) ::= "<if(types)>extends <types; separator=\",\"><endif>"
imps(types) ::= "<if(types)>implements <types; separator=\",\"><endif>"
// ******* EXPRESSIONS *******
cast_expr(type, exp) ::= "(<type>)<exp>"
// ******* UTILITY ***********
string(payload) ::= "<payload>"