mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
more output
This commit is contained in:
parent
69955f78ff
commit
c99eb4a136
@ -136,7 +136,7 @@ namespace_member_declaration
|
|||||||
}
|
}
|
||||||
:
|
:
|
||||||
namespace_declaration
|
namespace_declaration
|
||||||
| attributes? modifiers? ty=type_declaration { isCompUnit = true; } -> ^(PACKAGE[$ty.start.Token] PAYLOAD[ns] { mangleModifiersForType($modifiers.tree) } type_declaration);
|
| attributes? modifiers? ty=type_declaration { isCompUnit = true; } -> ^(PACKAGE[$ty.start.Token, "package"] PAYLOAD[ns] { mangleModifiersForType($modifiers.tree) } type_declaration);
|
||||||
// type_declaration is only called at the top level, so each of the types declared
|
// type_declaration is only called at the top level, so each of the types declared
|
||||||
// here will become a Java compilation unit (and go to its own file)
|
// here will become a Java compilation unit (and go to its own file)
|
||||||
type_declaration returns [string name]
|
type_declaration returns [string name]
|
||||||
|
@ -110,9 +110,9 @@ class_member_declaration:
|
|||||||
)
|
)
|
||||||
// common_modifiers// (method_modifiers | field_modifiers)
|
// common_modifiers// (method_modifiers | field_modifiers)
|
||||||
|
|
||||||
| class_declaration[$m.st] // 'class'
|
| c2=class_declaration[$m.st] -> { $c2.st } // 'class'
|
||||||
| struct_declaration // 'struct'
|
| s2=struct_declaration -> { $s2.st }// 'struct'
|
||||||
| enum_declaration[$m.st] // 'enum'
|
| e2=enum_declaration[$m.st] -> { $e2.st } // 'enum'
|
||||||
| delegate_declaration // 'delegate'
|
| delegate_declaration // 'delegate'
|
||||||
| conversion_operator_declaration
|
| conversion_operator_declaration
|
||||||
| constructor_declaration // | static_constructor_declaration
|
| constructor_declaration // | static_constructor_declaration
|
||||||
@ -123,7 +123,7 @@ class_member_declaration:
|
|||||||
primary_expression:
|
primary_expression:
|
||||||
('this' brackets) => 'this' brackets primary_expression_part*
|
('this' brackets) => 'this' brackets primary_expression_part*
|
||||||
| ('base' brackets) => 'this' brackets primary_expression_part*
|
| ('base' brackets) => 'this' brackets primary_expression_part*
|
||||||
| primary_expression_start primary_expression_part*
|
| primary_expression_start pp+=primary_expression_part* -> primary_expression_start_parts(start={ $primary_expression_start.st }, follows={ $pp })
|
||||||
| 'new' ( (object_creation_expression ('.'|'->'|'[')) =>
|
| 'new' ( (object_creation_expression ('.'|'->'|'[')) =>
|
||||||
object_creation_expression primary_expression_part+ // new Foo(arg, arg).Member
|
object_creation_expression primary_expression_part+ // new Foo(arg, arg).Member
|
||||||
// try the simple one first, this has no argS and no expressions
|
// try the simple one first, this has no argS and no expressions
|
||||||
@ -146,7 +146,7 @@ primary_expression_start:
|
|||||||
| 'base'
|
| 'base'
|
||||||
| paren_expression
|
| paren_expression
|
||||||
| typeof_expression // typeof(Foo).Name
|
| typeof_expression // typeof(Foo).Name
|
||||||
| literal
|
| literal -> { $literal.st }
|
||||||
;
|
;
|
||||||
|
|
||||||
primary_expression_part:
|
primary_expression_part:
|
||||||
@ -207,8 +207,8 @@ member_declarator_list:
|
|||||||
member_declarator:
|
member_declarator:
|
||||||
qid ('=' expression)? ;
|
qid ('=' expression)? ;
|
||||||
primary_or_array_creation_expression:
|
primary_or_array_creation_expression:
|
||||||
(array_creation_expression) => array_creation_expression
|
(array_creation_expression) => array_creation_expression -> { $array_creation_expression.st }
|
||||||
| primary_expression
|
| primary_expression -> { $primary_expression.st }
|
||||||
;
|
;
|
||||||
// new Type[2] { }
|
// new Type[2] { }
|
||||||
array_creation_expression:
|
array_creation_expression:
|
||||||
@ -230,7 +230,7 @@ array_initializer:
|
|||||||
variable_initializer_list:
|
variable_initializer_list:
|
||||||
variable_initializer (',' variable_initializer)* ;
|
variable_initializer (',' variable_initializer)* ;
|
||||||
variable_initializer:
|
variable_initializer:
|
||||||
expression | array_initializer ;
|
expression -> { $expression.st } | array_initializer -> { $array_initializer.st };
|
||||||
sizeof_expression:
|
sizeof_expression:
|
||||||
'sizeof' '(' unmanaged_type ')';
|
'sizeof' '(' unmanaged_type ')';
|
||||||
checked_expression:
|
checked_expression:
|
||||||
@ -389,7 +389,7 @@ statement_list:
|
|||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
expression:
|
expression:
|
||||||
(unary_expression assignment_operator) => assignment
|
(unary_expression assignment_operator) => assignment
|
||||||
| non_assignment_expression
|
| non_assignment_expression -> { $non_assignment_expression.st }
|
||||||
;
|
;
|
||||||
expression_list:
|
expression_list:
|
||||||
expression (',' expression)* ;
|
expression (',' expression)* ;
|
||||||
@ -397,12 +397,13 @@ assignment:
|
|||||||
unary_expression assignment_operator expression ;
|
unary_expression assignment_operator expression ;
|
||||||
unary_expression:
|
unary_expression:
|
||||||
//('(' arguments ')' ('[' | '.' | '(')) => primary_or_array_creation_expression
|
//('(' arguments ')' ('[' | '.' | '(')) => primary_or_array_creation_expression
|
||||||
(cast_expression) => cast_expression
|
// ^(CAST_EXPR type expression)
|
||||||
| primary_or_array_creation_expression
|
(cast_expression) => cast_expression
|
||||||
| '+' unary_expression
|
| primary_or_array_creation_expression -> { $primary_or_array_creation_expression.st }
|
||||||
| '-' unary_expression
|
| '+' u1=unary_expression -> template(e={$u1.st}) "+<e>"
|
||||||
| '!' unary_expression
|
| '-' u2=unary_expression -> template(e={$u2.st}) "-<e>"
|
||||||
| '~' unary_expression
|
| '!' u3=unary_expression -> template(e={$u3.st}) "!<e>"
|
||||||
|
| '~' u4=unary_expression -> template(e={$u4.st}) "~<e>"
|
||||||
| pre_increment_expression
|
| pre_increment_expression
|
||||||
| pre_decrement_expression
|
| pre_decrement_expression
|
||||||
| pointer_indirection_expression
|
| pointer_indirection_expression
|
||||||
@ -622,11 +623,11 @@ constant_expression:
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
field_declaration:
|
field_declaration:
|
||||||
variable_declarators ';' ;
|
variable_declarators ';' -> { $variable_declarators.st };
|
||||||
variable_declarators:
|
variable_declarators:
|
||||||
variable_declarator (',' variable_declarator)* ;
|
vs+=variable_declarator (',' vs+=variable_declarator)* -> variable_declarators(varinits = {$vs});
|
||||||
variable_declarator:
|
variable_declarator:
|
||||||
type_name ('=' variable_initializer)? ; // eg. event EventHandler IInterface.VariableName = Foo;
|
type_name ('=' variable_initializer)? -> variable_declarator(typename = { $type_name.st }, init = { $variable_initializer.st}) ; // eg. event EventHandler IInterface.VariableName = Foo;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
method_declaration:
|
method_declaration:
|
||||||
@ -1090,6 +1091,6 @@ literal:
|
|||||||
| Verbatim_string_literal
|
| Verbatim_string_literal
|
||||||
| TRUE
|
| TRUE
|
||||||
| FALSE
|
| FALSE
|
||||||
| NULL
|
| NULL -> string(payload={"null"})
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user