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

No UNARY_EXPR in PrettyPrint, actually create unary expressions :(

This commit is contained in:
Kevin Glynn 2010-11-24 17:13:39 +01:00
parent 1f2374d213
commit b48d69e443
3 changed files with 7 additions and 8 deletions

View File

@ -524,8 +524,8 @@ additive_expression:
multiplicative_expression (('+'|'-')^ multiplicative_expression)* ;
// >> check needed (no whitespace)
shift_expression:
a1=additive_expression ((so='<<' a3=additive_expression -> ^($so $a1 $a3))
| ('>' '>' a2=additive_expression -> ^(RIGHT_SHIFT $a1 $a2))
(a1=additive_expression -> $a1) ((so='<<' a3=additive_expression -> ^($so $shift_expression $a3))
| ('>' '>' a2=additive_expression -> ^(RIGHT_SHIFT $shift_expression $a2))
)* ;
relational_expression:
(s1=shift_expression -> $s1)

View File

@ -351,7 +351,7 @@ type
List<string> stars = new List<string>();
string opt = null;
}:
^(TYPE (tp=predefined_type {nm=$tp.st;} | tn=type_name {nm=$tn.st;}) rank_specifiers ('*' { stars.Add("*");})* ('?' { opt = "?";} )?) -> type(name={ nm }, stars={ stars }, rs={ $rank_specifiers.st }, opt={ opt })
^(TYPE (tp=predefined_type {nm=$tp.st;} | tn=type_name {nm=$tn.st;}) rank_specifiers? ('*' { stars.Add("*");})* ('?' { opt = "?";} )?) -> type(name={ nm }, stars={ stars }, rs={ $rank_specifiers.st }, opt={ opt })
;
non_nullable_type:
type -> { $type.st } ;
@ -440,7 +440,7 @@ non_assignment_expression:
| ^('*' non_assignment_expression non_assignment_expression)
| ^('/' non_assignment_expression non_assignment_expression)
| ^('%' non_assignment_expression non_assignment_expression)
| ^(UNARY_EXPR unary_expression) -> { $unary_expression.st }
| unary_expression -> { $unary_expression.st }
;
///////////////////////////////////////////////////////
@ -1067,8 +1067,8 @@ literal:
| Character_literal
| STRINGLITERAL
| Verbatim_string_literal
| TRUE
| FALSE
| TRUE -> string(payload={"true"})
| FALSE -> string(payload={"false"})
| NULL -> string(payload={"null"})
;

View File

@ -290,7 +290,7 @@ type_arguments:
type (',' type)* ;
type:
^(TYPE (predefined_type | type_name) rank_specifiers '*'* '?'?);
^(TYPE (predefined_type | type_name) rank_specifiers? '*'* '?'?);
non_nullable_type:
type;
non_array_type:
@ -353,7 +353,6 @@ pointer_indirection_expression:
addressof_expression:
'&' unary_expression ;
non_assignment_expression:
//'non ASSIGNment'
(anonymous_function_signature '=>') => lambda_expression