b) Interface construct
@Begin
- @Interface: ...
+ @Interface_decl: ...
@Commit_point_set:
IDENTIFIER | IDENTIFIER ...
@Condition: ... (Optional)
@Begin
@Interface_define: <Interface_Name>
@End
+
+ g) Interface declare & define construct
+ @Begin
+ @Interface_decl_define: <Interface_Name>
+ @Commit_point_set:
+ IDENTIFIER | IDENTIFIER ...
+ @Condition: ... (Optional)
+ @HB_Condition:
+ IDENTIFIER :: <C_CPP_Condition>
+ @HB_Condition: ...
+ @ID: ... (Optional, use default ID)
+ @Check: (Optional)
+ ...
+ @Action: (Optional)
+ ...
+ @Post_action: (Optional)
+ @Post_check: (Optional)
+ @End
+
*/
<COLON: ":">
|
<DOUBLECOLON: "::">
+|
+ <DOUBLELESSTHAN: "<<">
+|
+ <DOUBLEGREATERTHAN: ">>">
+|
+ <TRIPLEGREATERTHAN: ">>>">
+|
+ <PLUS_EQUALS: "+=">
+|
+ <MINUS_EQUALS: "-=">
+|
+ <TIMES_EQUALS: "*=">
+|
+ <DIVIDE_EQUALS: "/=">
+|
+ <MOD_EQUALS: "%=">
+|
+ <XOR_EQUALS: "^=">
+|
+ <OR_EQUALS: "|=">
+|
+ <AND_EQUALS: "&=">
+
|
<SEMI_COLON: ";">
|
FunctionHeader FuncDecl() :
{
+ ArrayList<VariableDeclaration> templateList;
String ret;
QualifiedName funcName;
ArrayList<VariableDeclaration> args;
}
{
+aa
(<STATIC> | <INLINE>)*
ret = Type()
funcName = ParseQualifiedName()
}
}
-ArrayList<String> TemplateParamList() :
+ArrayList<VariableDeclaration> TemplateParamList() :
{
- ArrayList<String> params;
- String str;
+ ArrayList<VariableDeclaration> params;
+ String type;
+ String name;
}
{
{
- params = new ArrayList<String>();
+ params = new ArrayList<VariableDeclaration>();
}
<TEMPLATE>
"<"
- (str = <IDENTIFIER>.image
- str = <IDENTIFIER>.image {params.add(str);})
+ (type = <IDENTIFIER>.image
+ name = <IDENTIFIER>.image
+ {
+ params.add(new VariableDeclaration(type, name));
+ }
+ )
- ("," str = <IDENTIFIER>.image
- str = <IDENTIFIER>.image {params.add(str);})*
+ ("," type = <IDENTIFIER>.image
+ name = <IDENTIFIER>.image
+ {
+ params.add(new VariableDeclaration(type, name));
+ }
+ )*
">"
{
//System.out.println(params);
t = <GREATER_EQUALS> | t = <LESS_EQUALS> |
t = <LOGICAL_EQUALS> | t = <NOT_EQUALS> | t = <LOGICAL_AND> | t = <LOGICAL_OR> | t = <XOR> |
t = <QUESTION_MARK> | t = <COLON> | t = <DOUBLECOLON> |
+ t = <DOUBLELESSTHAN> |
+ t = <DOUBLEGREATERTHAN> |
+ t = <TRIPLEGREATERTHAN> |
+
+ t = <PLUS_EQUALS> |
+ t = <MINUS_EQUALS> |
+ t = <TIMES_EQUALS> |
+ t = <DIVIDE_EQUALS> |
+ t = <MOD_EQUALS> |
+ t = <XOR_EQUALS> |
+ t = <OR_EQUALS> |
+ t = <AND_EQUALS> |
+
(t = <SEMI_COLON> { newLine = true; } )
| t = <STRING_LITERAL> | t = <CHARACTER_LITERAL> |
t = <INTEGER_LITERAL> | t = <FLOATING_POINT_LITERAL> |