FortranParserActionTreeMaker.java
package fortran.ofp.parser.java;
import java.util.Stack;
import org.antlr.runtime.Token;
public class FortranParserActionTreeMaker implements IFortranParserAction {
private FortranNode root;
private Stack<FortranNode> stack = new Stack<FortranNode>();
public FortranParserActionTreeMaker(String[] args, IFortranParser parser,
String filename) {
super();
}
/**
* R102 Begin
*/
public void generic_name_list__begin() {
// Do nothing
}
/**
* R102 List
*/
public void generic_name_list(int count) {
int counter = 0;
FortranNode temp = null;
FortranNode generic_name_list_Node = new FortranNode(102, "ArgsList["
+ counter + "]");
counter = count;
while (counter > 0) {
assert !stack.empty();
temp = stack.pop();
assert temp.rule() == 102;
generic_name_list_Node.addChild(0, temp);
counter--;
}
stack.push(generic_name_list_Node);
}
/**
* R102 Element
*/
public void generic_name_list_part(Token ident) {
FortranNode generic_name_list_part_Node = new FortranNode(102,
"ArgName", ident);
stack.push(generic_name_list_part_Node);
}
/**
* R204
*/
public void specification_part(int numUseStmts, int numImportStmts,
int numImplStmts, int numDeclConstructs) {
int counter = 0;
FortranNode temp = null;
FortranNode specification_part_Node = new FortranNode(204, "SpecPart");
counter = numUseStmts;
while (counter > 0) {
assert false;
assert !stack.empty();
temp = stack.pop();
assert false;// TODO: modify to rule of use
// assert temp.rule() == 207;
specification_part_Node.addChild(0, temp);
counter--;
}
counter = numImportStmts;
while (counter > 0) {
assert false;
assert !stack.empty();
temp = stack.pop();
assert false;// TODO: modify to rule of import
// assert temp.rule() == 207;
specification_part_Node.addChild(0, temp);
counter--;
}
counter = numImplStmts;
while (counter > 0) {
assert false;
assert !stack.empty();
temp = stack.pop();
assert false;// TODO: modify to rule of impl
// assert temp.rule() == 207;
specification_part_Node.addChild(0, temp);
counter--;
}
counter = numDeclConstructs;
while (counter > 0) {
assert !stack.empty();
temp = stack.pop();
assert temp.rule() == 207;
specification_part_Node.addChild(0, temp);
counter--;
}
stack.push(specification_part_Node);
}
/**
* R207
*/
public void declaration_construct() {
FortranNode temp = null;
FortranNode declaration_construct_Node = new FortranNode(207,
"DeclConstruct");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 501;
declaration_construct_Node.addChild(temp);
stack.push(declaration_construct_Node);
}
/**
* R208
*/
public void execution_part() {
int rule = -1;
FortranNode temp = null;
FortranNode execution_part_Node = new FortranNode(208, "ExecPart");
while (!stack.isEmpty()) {
rule = stack.peek().rule();
if (rule == 213) {
temp = stack.pop();
execution_part_Node.addChild(0, temp);
} else {
break;
}
}
stack.push(execution_part_Node);
}
/**
* R209
*/
public void execution_part_construct() {
// Omitted, with R208
}
public void internal_subprogram_part(int count) {
}
public void internal_subprogram() {
}
public void specification_stmt() {
}
/**
* R213
*/
public void executable_construct() {
int rule = -1;
FortranNode temp = null;
FortranNode executable_construct_Node = new FortranNode(213,
"ExecConstruct");
assert !stack.empty();
temp = stack.pop();
rule = temp.rule();
assert rule == 214 /* ActionStmt */
|| rule == 825 /* DoConstruct */
;// TODO:
executable_construct_Node.addChild(temp);
stack.push(executable_construct_Node);
}
/**
* R214
*/
public void action_stmt() {
int rule = -1;
FortranNode temp = null;
FortranNode action_stmt_Node = new FortranNode(214, "ActionStmt");
assert !stack.empty();
temp = stack.pop();
rule = temp.rule();
assert rule == 734 /* AssignmentStmt */
|| rule == 807 /* IfStmt */
|| rule == 845 /* GotoStmt */
| rule == 848 /* ContinueStmt */
|| rule == 1236 /* ReturnStmt */
;
action_stmt_Node.addChild(temp);
stack.push(action_stmt_Node);
}
public void keyword() {
}
public void name(Token id) {
}
public void constant(Token id) {
}
public void scalar_constant() {
}
/**
* R306
*/
public void literal_constant() {
int rule = -1;
FortranNode temp = null;
FortranNode literal_constant_Node = new FortranNode(306, "LiteralConst");
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 406 /* IntLitConst */
|| rule == 417 /* RealLitConst */
|| rule == 421 /* CompLitConst */
; // TODO;
literal_constant_Node.addChild(temp);
stack.push(literal_constant_Node);
}
public void int_constant(Token id) {
}
public void char_constant(Token id) {
}
public void intrinsic_operator() {
}
public void defined_operator(Token definedOp, boolean isExtended) {
}
public void extended_intrinsic_op() {
}
public void label(Token lbl) {
}
public void label_list__begin() {
}
public void label_list(int count) {
}
public void type_spec() {
}
public void type_param_value(boolean hasExpr, boolean hasAsterisk,
boolean hasColon) {
}
/**
* R403
*/
public void intrinsic_type_spec(Token keyword1, Token keyword2, int type,
boolean hasKindSelector) {
FortranNode temp = null;
FortranNode intrinsic_type_spec_Node = new FortranNode(403,
"IntrinsicTypeSpec(" + type + ")");
FortranNode keyword1_Node = new FortranNode(-1, "Keyword1", keyword1);
FortranNode keyword2_Node = new FortranNode(-1, "Keyword2", keyword2);
intrinsic_type_spec_Node.addChild(keyword1_Node);
intrinsic_type_spec_Node.addChild(keyword2_Node);
if (hasKindSelector) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 404;
intrinsic_type_spec_Node.addChild(temp);
}
stack.push(intrinsic_type_spec_Node);
}
/**
* R404
*/
public void kind_selector(Token token1, Token token2, boolean hasExpression) {
FortranNode temp = null;
FortranNode kind_selector_Node = new FortranNode(404, "KindSelector");
FortranNode token1_Node = new FortranNode(-1, "Token1", token1);
FortranNode token2_Node = new FortranNode(-1, "Token2", token2);
kind_selector_Node.addChild(token1_Node);
kind_selector_Node.addChild(token2_Node);
if (hasExpression) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 701;
kind_selector_Node.addChild(temp);
}
stack.push(kind_selector_Node);
}
/**
* R405
*/
public void signed_int_literal_constant(Token sign) {
FortranNode temp = null;
FortranNode signed_int_literal_constant = new FortranNode(405,
"SignedIntConst");
FortranNode sign_Node = new FortranNode(-1, "Sign", sign);
signed_int_literal_constant.addChild(sign_Node);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 406;
signed_int_literal_constant.addChild(temp);
stack.push(signed_int_literal_constant);
}
/**
* R406
*/
public void int_literal_constant(Token digitString, Token kindParam) {
FortranNode int_literal_constant_Node = new FortranNode(406,
"IntLitConst");
FortranNode digitString_Node = new FortranNode(-1, "Digit", digitString);
FortranNode kindParam_Node = new FortranNode(-1, "Kind", kindParam);
int_literal_constant_Node.addChild(digitString_Node);
int_literal_constant_Node.addChild(kindParam_Node);
stack.push(int_literal_constant_Node);
}
public void kind_param(Token kind) {
}
public void boz_literal_constant(Token constant) {
}
/**
* R416
*/
public void signed_real_literal_constant(Token sign) {
FortranNode temp = null;
FortranNode signed_real_literal_constant_Node = new FortranNode(416,
"SignedRealConst");
FortranNode sign_Node = new FortranNode(-1, "Sign", sign);
signed_real_literal_constant_Node.addChild(sign_Node);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 417;
signed_real_literal_constant_Node.addChild(temp);
stack.push(signed_real_literal_constant_Node);
}
/**
* R417
*/
public void real_literal_constant(Token realConstant, Token kindParam) {
FortranNode int_literal_constant_Node = new FortranNode(417,
"RealLitConst");
FortranNode realConstant_Node = new FortranNode(-1, "RealConst",
realConstant);
FortranNode kindParam_Node = new FortranNode(-1, "Kind", kindParam);
int_literal_constant_Node.addChild(realConstant_Node);
int_literal_constant_Node.addChild(kindParam_Node);
stack.push(int_literal_constant_Node);
}
/**
* R421
*/
public void complex_literal_constant() {
FortranNode temp = null;
FortranNode complex_literal_constant_Node = new FortranNode(421,
"CompLitConst");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 423;
complex_literal_constant_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 422;
complex_literal_constant_Node.addChild(0, temp);
stack.push(complex_literal_constant_Node);
}
/**
* R422
*/
public void real_part(boolean hasIntConstant, boolean hasRealConstant,
Token id) {
FortranNode temp = null;
FortranNode real_part_Node = new FortranNode(422, "RealPart");
FortranNode id_Node = new FortranNode(-1, "ID");
if (hasIntConstant) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 405;
real_part_Node.addChild(temp);
} else if (hasRealConstant) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 416;
real_part_Node.addChild(temp);
} else {
real_part_Node.addChild(id_Node);
}
stack.push(real_part_Node);
}
/**
* R423
*/
public void imag_part(boolean hasIntConstant, boolean hasRealConstant,
Token id) {
FortranNode temp = null;
FortranNode imag_part_Node = new FortranNode(423, "ImagPart");
FortranNode id_Node = new FortranNode(-1, "ID");
if (hasIntConstant) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 405;
imag_part_Node.addChild(temp);
} else if (hasRealConstant) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 416;
imag_part_Node.addChild(temp);
} else {
imag_part_Node.addChild(id_Node);
}
stack.push(imag_part_Node);
}
public void char_selector(Token tk1, Token tk2, int kindOrLen1,
int kindOrLen2, boolean hasAsterisk) {
}
public void length_selector(Token len, int kindOrLen, boolean hasAsterisk) {
}
public void char_length(boolean hasTypeParamValue) {
}
public void scalar_int_literal_constant() {
}
public void char_literal_constant(Token digitString, Token id, Token str) {
}
public void logical_literal_constant(Token logicalValue, boolean isTrue,
Token kindParam) {
}
public void hollerith_literal_constant(Token hollerithConstant) {
}
public void derived_type_def() {
}
public void type_param_or_comp_def_stmt(Token eos, int type) {
}
public void type_param_or_comp_def_stmt_list() {
}
public void derived_type_stmt(Token label, Token keyword, Token id,
Token eos, boolean hasTypeAttrSpecList, boolean hasGenericNameList) {
}
public void type_attr_spec(Token keyword, Token id, int specType) {
}
public void type_attr_spec_list__begin() {
}
public void type_attr_spec_list(int count) {
}
public void private_or_sequence() {
}
public void end_type_stmt(Token label, Token endKeyword, Token typeKeyword,
Token id, Token eos) {
}
public void sequence_stmt(Token label, Token sequenceKeyword, Token eos) {
}
public void type_param_decl(Token id, boolean hasInit) {
}
public void type_param_decl_list__begin() {
}
public void type_param_decl_list(int count) {
}
public void type_param_attr_spec(Token kindOrLen) {
}
public void component_def_stmt(int type) {
}
public void data_component_def_stmt(Token label, Token eos, boolean hasSpec) {
}
public void component_attr_spec(Token attrKeyword, int specType) {
}
public void component_attr_spec_list__begin() {
}
public void component_attr_spec_list(int count) {
}
public void component_decl(Token id, boolean hasComponentArraySpec,
boolean hasCoarraySpec, boolean hasCharLength,
boolean hasComponentInitialization) {
}
public void component_decl_list__begin() {
}
public void component_decl_list(int count) {
}
public void component_array_spec(boolean isExplicit) {
}
public void deferred_shape_spec_list__begin() {
}
public void deferred_shape_spec_list(int count) {
}
public void component_initialization() {
}
public void proc_component_def_stmt(Token label, Token procedureKeyword,
Token eos, boolean hasInterface) {
}
public void proc_component_attr_spec(Token attrSpecKeyword, Token id,
int specType) {
}
public void proc_component_attr_spec_list__begin() {
}
public void proc_component_attr_spec_list(int count) {
}
public void private_components_stmt(Token label, Token privateKeyword,
Token eos) {
}
public void type_bound_procedure_part(int count,
boolean hasBindingPrivateStmt) {
}
public void binding_private_stmt(Token label, Token privateKeyword,
Token eos) {
}
public void proc_binding_stmt(Token label, int type, Token eos) {
}
public void specific_binding(Token procedureKeyword, Token interfaceName,
Token bindingName, Token procedureName, boolean hasBindingAttrList) {
}
public void generic_binding(Token genericKeyword, boolean hasAccessSpec) {
}
public void binding_attr(Token bindingAttr, int attr, Token id) {
}
public void binding_attr_list__begin() {
}
public void binding_attr_list(int count) {
}
public void final_binding(Token finalKeyword) {
}
public void derived_type_spec(Token typeName, boolean hasTypeParamSpecList) {
}
public void type_param_spec(Token keyword) {
}
public void type_param_spec_list__begin() {
}
public void type_param_spec_list(int count) {
}
public void structure_constructor(Token id) {
}
public void component_spec(Token id) {
}
public void component_spec_list__begin() {
}
public void component_spec_list(int count) {
}
public void component_data_source() {
}
public void enum_def(int numEls) {
}
public void enum_def_stmt(Token label, Token enumKeyword,
Token bindKeyword, Token id, Token eos) {
}
public void enumerator_def_stmt(Token label, Token enumeratorKeyword,
Token eos) {
}
public void enumerator(Token id, boolean hasExpr) {
}
public void enumerator_list__begin() {
}
public void enumerator_list(int count) {
}
public void end_enum_stmt(Token label, Token endKeyword, Token enumKeyword,
Token eos) {
}
public void array_constructor() {
}
public void ac_spec() {
}
public void ac_value() {
}
public void ac_value_list__begin() {
}
public void ac_value_list(int count) {
}
public void ac_implied_do() {
}
public void ac_implied_do_control(boolean hasStride) {
}
public void scalar_int_variable() {
}
/**
* R501
*/
public void type_declaration_stmt(Token label, int numAttributes, Token eos) {
int counter = 0;
FortranNode temp = null;
FortranNode type_declaration_stmt_Node = new FortranNode(501,
"TypeDeclStmt(" + counter + ")");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
type_declaration_stmt_Node.addChild(label_Node);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 503;
type_declaration_stmt_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 502;
type_declaration_stmt_Node.addChild(1, temp);
counter = numAttributes; // TODO: Finish attr parts
while (counter > 0) {
assert false;
counter--;
}
stack.push(type_declaration_stmt_Node);
}
/**
* R502
*/
public void declaration_type_spec(Token udtKeyword, int type) {
FortranNode temp = null;
FortranNode declaration_type_spec_Node = new FortranNode(502,
"DeclTypeSpec(" + type + ")", udtKeyword);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 403;
declaration_type_spec_Node.addChild(temp);
stack.push(declaration_type_spec_Node);
}
public void attr_spec(Token attrKeyword, int attr) {
}
/**
* R503 Element
*/
public void entity_decl(Token id, boolean hasArraySpec,
boolean hasCoarraySpec, boolean hasCharLength,
boolean hasInitialization) {
FortranNode temp = null;
FortranNode entity_decl_Node = new FortranNode(503, "EntityDecl");
FortranNode id_Node = new FortranNode(-1, "ID", id);
entity_decl_Node.addChild(id_Node);
if (hasInitialization) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 506;
entity_decl_Node.addChild(temp);
}
if (hasCharLength) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 426;
entity_decl_Node.addChild(temp);
}
if (hasCoarraySpec) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 509;
entity_decl_Node.addChild(temp);
}
if (hasArraySpec) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 510;
entity_decl_Node.addChild(temp);
}
stack.push(entity_decl_Node);
}
/**
* R503 Begin
*/
public void entity_decl_list__begin() {
// Do nothing.
}
/**
* R503 List
*/
public void entity_decl_list(int count) {
FortranNode temp = null;
int counter = count;
FortranNode entity_decl_list_Node = new FortranNode(503,
"EntityDeclList[" + counter + "]");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 503;
entity_decl_list_Node.addChild(0, temp);
counter--;
}
stack.push(entity_decl_list_Node);
}
/**
* R506
*/
public void initialization(boolean hasExpr, boolean hasNullInit) {
FortranNode temp = null;
FortranNode init_Node = new FortranNode(506, "Init");
if (hasExpr) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 701;// TODO: May not only 701
init_Node.addChild(temp);
}
if (hasNullInit) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 507;
init_Node.addChild(temp);
}
stack.push(init_Node);
}
public void null_init(Token id) {
}
public void access_spec(Token keyword, int type) {
}
public void language_binding_spec(Token keyword, Token id, boolean hasName) {
}
public void coarray_spec(int count) {
}
/**
* R510 Array
*/
public void array_spec(int count) {
int counter = 0;
FortranNode temp = null;
FortranNode array_spec_Node = new FortranNode(510, "ArraySpec["
+ counter + "]");
counter = count;
while (counter > 0) {
assert !stack.empty();
temp = stack.pop();
assert temp.rule() == 510;
array_spec_Node.addChild(0, temp);
counter--;
}
stack.push(array_spec_Node);
}
/**
* R510 Element
*/
public void array_spec_element(int type) {
FortranNode array_spec_element_Node = new FortranNode(510,
"ArrayElement(" + type + ")");
stack.push(array_spec_element_Node);
}
public void explicit_shape_spec(boolean hasUpperBound) {
}
public void explicit_shape_spec_list__begin() {
}
public void explicit_shape_spec_list(int count) {
}
public void intent_spec(Token intentKeyword1, Token intentKeyword2,
int intent) {
}
public void access_stmt(Token label, Token eos, boolean hasList) {
}
public void access_id() {
}
public void access_id_list__begin() {
}
public void access_id_list(int count) {
}
public void allocatable_stmt(Token label, Token keyword, Token eos) {
}
public void allocatable_decl(Token id, boolean hasArraySpec,
boolean hasCoarraySpec) {
}
public void allocatable_decl_list__begin() {
}
public void allocatable_decl_list(int count) {
}
public void asynchronous_stmt(Token label, Token keyword, Token eos) {
}
public void bind_stmt(Token label, Token eos) {
}
public void bind_entity(Token entity, boolean isCommonBlockName) {
}
public void bind_entity_list__begin() {
}
public void bind_entity_list(int count) {
}
public void codimension_stmt(Token label, Token keyword, Token eos) {
}
public void codimension_decl(Token coarrayName, Token lbracket,
Token rbracket) {
}
public void codimension_decl_list__begin() {
}
public void codimension_decl_list(int count) {
}
public void data_stmt(Token label, Token keyword, Token eos, int count) {
}
public void data_stmt_set() {
}
public void data_stmt_object() {
}
public void data_stmt_object_list__begin() {
}
public void data_stmt_object_list(int count) {
}
public void data_implied_do(Token id, boolean hasThirdExpr) {
}
public void data_i_do_object() {
}
public void data_i_do_object_list__begin() {
}
public void data_i_do_object_list(int count) {
}
public void data_stmt_value(Token asterisk) {
}
public void data_stmt_value_list__begin() {
}
public void data_stmt_value_list(int count) {
}
public void scalar_int_constant() {
}
public void data_stmt_constant() {
}
public void dimension_stmt(Token label, Token keyword, Token eos, int count) {
}
public void dimension_decl(Token id) {
}
public void intent_stmt(Token label, Token keyword, Token eos) {
}
public void optional_stmt(Token label, Token keyword, Token eos) {
}
public void parameter_stmt(Token label, Token keyword, Token eos) {
}
public void named_constant_def_list__begin() {
}
public void named_constant_def_list(int count) {
}
public void named_constant_def(Token id) {
}
public void pointer_stmt(Token label, Token keyword, Token eos) {
}
public void pointer_decl_list__begin() {
}
public void pointer_decl_list(int count) {
}
public void pointer_decl(Token id, boolean hasSpecList) {
}
public void cray_pointer_stmt(Token label, Token keyword, Token eos) {
}
public void cray_pointer_assoc_list__begin() {
}
public void cray_pointer_assoc_list(int count) {
}
public void cray_pointer_assoc(Token pointer, Token pointee) {
}
public void protected_stmt(Token label, Token keyword, Token eos) {
}
public void save_stmt(Token label, Token keyword, Token eos,
boolean hasSavedEntityList) {
}
public void saved_entity_list__begin() {
}
public void saved_entity_list(int count) {
}
public void saved_entity(Token id, boolean isCommonBlockName) {
}
public void target_stmt(Token label, Token keyword, Token eos) {
}
public void target_decl(Token objName, boolean hasArraySpec,
boolean hasCoarraySpec) {
}
public void target_decl_list__begin() {
}
public void target_decl_list(int count) {
}
public void value_stmt(Token label, Token keyword, Token eos) {
}
public void volatile_stmt(Token label, Token keyword, Token eos) {
}
public void implicit_stmt(Token label, Token implicitKeyword,
Token noneKeyword, Token eos, boolean hasImplicitSpecList) {
}
public void implicit_spec() {
}
public void implicit_spec_list__begin() {
}
public void implicit_spec_list(int count) {
}
public void letter_spec(Token id1, Token id2) {
}
public void letter_spec_list__begin() {
}
public void letter_spec_list(int count) {
}
public void namelist_stmt(Token label, Token keyword, Token eos, int count) {
}
public void namelist_group_name(Token id) {
}
public void namelist_group_object(Token id) {
}
public void namelist_group_object_list__begin() {
}
public void namelist_group_object_list(int count) {
}
public void equivalence_stmt(Token label, Token equivalenceKeyword,
Token eos) {
}
public void equivalence_set() {
}
public void equivalence_set_list__begin() {
}
public void equivalence_set_list(int count) {
}
public void equivalence_object() {
}
public void equivalence_object_list__begin() {
}
public void equivalence_object_list(int count) {
}
public void common_stmt(Token label, Token commonKeyword, Token eos,
int numBlocks) {
}
public void common_block_name(Token id) {
}
public void common_block_object_list__begin() {
}
public void common_block_object_list(int count) {
}
public void common_block_object(Token id, boolean hasShapeSpecList) {
}
/**
* R601
*/
public void variable() {
FortranNode temp = null;
FortranNode variable_Node = new FortranNode(601, "Variable");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 603;// TODO: May not only 603
variable_Node.addChild(temp);
stack.push(variable_Node);
}
/**
* R603
*/
public void designator(boolean hasSubstringRange) {
FortranNode temp = null;
FortranNode designator_Node = new FortranNode(603, "Designator");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 612;// TODO: May not only 612
designator_Node.addChild(temp);
if (hasSubstringRange) {
assert false; // TODO:
}
stack.push(designator_Node);
}
/**
* R-3
*/
public void designator_or_func_ref() {
FortranNode temp = null;
FortranNode designator_or_func_ref_Node = new FortranNode(-3,
"DesignatorOrFunctionRef");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 612;// TODO: May not only 612
designator_or_func_ref_Node.addChild(temp);
stack.push(designator_or_func_ref_Node);
}
public void substring_range_or_arg_list() {
}
public void substr_range_or_arg_list_suffix() {
}
public void logical_variable() {
}
public void default_logical_variable() {
}
public void scalar_default_logical_variable() {
}
public void char_variable() {
}
public void default_char_variable() {
}
public void scalar_default_char_variable() {
}
public void int_variable() {
}
public void substring(boolean hasSubstringRange) {
}
public void substring_range(boolean hasLowerBound, boolean hasUpperBound) {
}
/**
* R612
*/
public void data_ref(int numPartRef) {
FortranNode temp = null;
int counter = numPartRef;
FortranNode data_ref_Node = new FortranNode(612, "DataRef");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 613;
data_ref_Node.addChild(0, temp);
counter--;
}
stack.push(data_ref_Node);
}
/**
* R613
*/
public void part_ref(Token id, boolean hasSelectionSubscriptList,
boolean hasImageSelector) {
FortranNode temp = null;
FortranNode part_ref = new FortranNode(613, "PartRef");
FortranNode id_Node = new FortranNode(-1, "ID", id);
part_ref.addChild(id_Node);
if (hasSelectionSubscriptList) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 619;
part_ref.addChild(temp);
}
if (hasImageSelector) {
assert false;
}
stack.push(part_ref);
}
/**
* R619 Element
*/
public void section_subscript(boolean hasLowerBound, boolean hasUpperBound,
boolean hasStride, boolean isAmbiguous) {
FortranNode temp = null;
FortranNode section_subscript_Node = new FortranNode(619,
"SecSubscript");
if (hasLowerBound) {
}
if (hasUpperBound) {
}
if (hasStride) {
}
if (isAmbiguous) {
}
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 701; // TODO:
section_subscript_Node.addChild(temp);
stack.push(section_subscript_Node);
}
/**
* R619 Begin
*/
public void section_subscript_list__begin() {
// Do nothing
}
/**
* R619 List
*/
public void section_subscript_list(int count) {
int counter = 0;
FortranNode temp = null;
FortranNode section_subscript_list_Node = new FortranNode(619,
"SectionSubscriptList[" + counter + "]");
counter = count;
while (counter > 0) {
assert !stack.empty();
temp = stack.pop();
assert temp.rule() == 619;
section_subscript_list_Node.addChild(0, temp);
counter--;
}
stack.push(section_subscript_list_Node);
}
public void vector_subscript() {
}
public void allocate_stmt(Token label, Token allocateKeyword, Token eos,
boolean hasTypeSpec, boolean hasAllocOptList) {
}
public void image_selector(Token leftBracket, Token rightBracket) {
}
public void alloc_opt(Token allocOpt) {
}
public void alloc_opt_list__begin() {
}
public void alloc_opt_list(int count) {
}
public void cosubscript_list__begin() {
}
public void cosubscript_list(int count, Token team) {
}
public void allocation(boolean hasAllocateShapeSpecList,
boolean hasAllocateCoarraySpec) {
}
public void allocation_list__begin() {
}
public void allocation_list(int count) {
}
public void allocate_object() {
}
public void allocate_object_list__begin() {
}
public void allocate_object_list(int count) {
}
public void allocate_shape_spec(boolean hasLowerBound, boolean hasUpperBound) {
}
public void allocate_shape_spec_list__begin() {
}
public void allocate_shape_spec_list(int count) {
}
public void nullify_stmt(Token label, Token nullifyKeyword, Token eos) {
}
public void pointer_object() {
}
public void pointer_object_list__begin() {
}
public void pointer_object_list(int count) {
}
public void deallocate_stmt(Token label, Token deallocateKeyword,
Token eos, boolean hasDeallocOptList) {
}
public void dealloc_opt(Token id) {
}
public void dealloc_opt_list__begin() {
}
public void dealloc_opt_list(int count) {
}
public void allocate_coarray_spec() {
}
public void allocate_coshape_spec(boolean hasExpr) {
}
public void allocate_coshape_spec_list__begin() {
}
public void allocate_coshape_spec_list(int count) {
}
/**
* R701
*/
public void primary() {
int rule = -1;
FortranNode temp = null;
FortranNode primary_Node = new FortranNode(701, "PrimaryExpr");
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == -3 /* DesignatorOrFunctionRef */
|| rule == 306 /* LiteralConst */
|| rule == 705 /* AddOperand */
;
// TODO: May not only -3
primary_Node.addChild(temp);
stack.push(primary_Node);
}
public void parenthesized_expr() {
}
public void level_1_expr(Token definedUnaryOp) {
}
public void defined_unary_op(Token definedOp) {
}
public void power_operand(boolean hasPowerOperand) {
}
public void power_operand__power_op(Token powerOp) {
}
/**
* R704 List
*/
public void mult_operand(int numMultOps) {
int counter = numMultOps;
if (counter > 0) {
FortranNode temp = null;
FortranNode mult_operand_Node = new FortranNode(704,
"MultOperands[" + counter + "]");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 704;
mult_operand_Node.addChild(0, temp);
counter--;
}
stack.push(mult_operand_Node);
}
}
/**
* R704 Element
*/
public void mult_operand__mult_op(Token multOp) {
if (multOp != null) {
int rule = -1;
FortranNode temp = null;
FortranNode mult_operand__mult_op_Node = new FortranNode(704,
"MultOperand");
FortranNode multOp_Node = new FortranNode(708, "MultOp", multOp);
mult_operand__mult_op_Node.addChild(multOp_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
;// TODO:
mult_operand__mult_op_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
;
mult_operand__mult_op_Node.addChild(1, temp);
stack.push(mult_operand__mult_op_Node);
}
}
/**
* R705 Element2
*/
public void signed_operand(Token addOp) {
if (addOp != null) {
int rule = -1;
FortranNode temp = null;
FortranNode signed_operand_Node = new FortranNode(705,
"SignedOperand");
FortranNode sign_Node = new FortranNode(709, "Sign", addOp);
signed_operand_Node.addChild(sign_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
;// TODO:
signed_operand_Node.addChild(temp);
stack.push(signed_operand_Node);
}
}
/**
* R705 List
*/
public void add_operand(int numAddOps) {
int counter = numAddOps;
if (counter > 0) {
FortranNode temp = null;
FortranNode add_operand_Node = new FortranNode(705, "AddOperands["
+ counter + "]");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 705;
add_operand_Node.addChild(0, temp);
counter--;
}
stack.push(add_operand_Node);
}
}
/**
* R705 Element
*/
public void add_operand__add_op(Token addOp) {
if (addOp != null) {
int rule = -1;
FortranNode temp = null;
FortranNode add_operand__add_op_Node = new FortranNode(705,
"AddOperand");
FortranNode addOp_Node = new FortranNode(709, "AddOp", addOp);
add_operand__add_op_Node.addChild(addOp_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
|| rule == 704 /* MultOperand */
;// TODO:
add_operand__add_op_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
|| rule == 705 /**/
|| rule == 704 /**/
;
add_operand__add_op_Node.addChild(1, temp);
stack.push(add_operand__add_op_Node);
}
}
public void level_2_expr(int numConcatOps) {
}
public void power_op(Token powerKeyword) {
}
/**
* R708
*/
public void mult_op(Token multKeyword) {
// Do nothing: merged into R704
}
/**
* R709
*/
public void add_op(Token addKeyword) {
// Do nothing: merged into R705
}
/**
* R710
*/
public void level_3_expr(Token relOp) {
if (relOp != null) {
int rule = -1;
FortranNode temp = null;
FortranNode level_3_expr_Node = new FortranNode(710, "Lv3Expr");
FortranNode relOp_Node = new FortranNode(713, "RelOp", relOp);
level_3_expr_Node.addChild(relOp_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701; // TODO:
level_3_expr_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* Primary */
|| rule == 705 /* AddOperand */
; // TODO:
level_3_expr_Node.addChild(0, temp);
stack.push(level_3_expr_Node);
}
}
public void concat_op(Token concatKeyword) {
}
/**
* R713
*/
public void rel_op(Token relOp) {
// Do nothing: Merged into R710
}
/**
* R714 List
*/
public void and_operand(boolean hasNotOp, int numAndOps) {
int counter = numAndOps;
if (counter > 0) {
FortranNode temp = null;
FortranNode and_operand_Node = new FortranNode(714, "AndOperands["
+ counter + "]");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 714;
and_operand_Node.addChild(0, temp);
counter--;
}
stack.push(and_operand_Node);
}
}
/**
* R714 Element
*/
public void and_operand__not_op(boolean hasNotOp) {
int rule = -1;
int index = 0;
FortranNode temp = null;
FortranNode and_operand__not_op_Node = new FortranNode(714,
"AndOperandNotOp");
if (hasNotOp) {
FortranNode notOp_Node = new FortranNode(719, "NotOp");
and_operand__not_op_Node.addChild(notOp_Node);
index = 1;
}
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
|| rule == 714 /* Lv3Expr */
|| rule == 710;
and_operand__not_op_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
|| rule == 714 /* Lv3Expr */
|| rule == 710;
and_operand__not_op_Node.addChild(index, temp);
stack.push(and_operand__not_op_Node);
}
public void or_operand(int numOrOps) {
}
public void equiv_operand(int numEquivOps) {
}
public void equiv_operand__equiv_op(Token equivOp) {
}
public void level_5_expr(int numDefinedBinaryOps) {
}
public void level_5_expr__defined_binary_op(Token definedBinaryOp) {
}
public void not_op(Token notOp) {
}
/**
* R719
*/
public void and_op(Token andOp) {
// Do nothing : Merged into R714
}
public void or_op(Token orOp) {
}
public void equiv_op(Token equivOp) {
}
/**
* R722
*/
public void expr() {
// Omitted, with R717
}
public void defined_binary_op(Token binaryOp) {
}
/**
* R734
*/
public void assignment_stmt(Token label, Token eos) {
int rule = -1;
FortranNode temp = null;
FortranNode assignment_stmt_Node = new FortranNode(734, "AssigmentStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
assignment_stmt_Node.addChild(label_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701 /* PrimaryExpr */
|| rule == 705 /* AddOperand */
;
assignment_stmt_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 601; // TODO: May not only 601
assignment_stmt_Node.addChild(1, temp);
stack.push(assignment_stmt_Node);
}
public void pointer_assignment_stmt(Token label, Token eos,
boolean hasBoundsSpecList, boolean hasBRList) {
}
public void data_pointer_object() {
}
public void bounds_spec() {
}
public void bounds_spec_list__begin() {
}
public void bounds_spec_list(int count) {
}
public void bounds_remapping() {
}
public void bounds_remapping_list__begin() {
}
public void bounds_remapping_list(int count) {
}
public void proc_pointer_object() {
}
public void where_stmt__begin() {
}
public void where_stmt(Token label, Token whereKeyword) {
}
public void where_construct(int numConstructs, boolean hasMaskedElsewhere,
boolean hasElsewhere) {
}
public void where_construct_stmt(Token id, Token whereKeyword, Token eos) {
}
public void where_body_construct() {
}
public void masked_elsewhere_stmt(Token label, Token elseKeyword,
Token whereKeyword, Token id, Token eos) {
}
public void masked_elsewhere_stmt__end(int numBodyConstructs) {
}
public void elsewhere_stmt(Token label, Token elseKeyword,
Token whereKeyword, Token id, Token eos) {
}
public void elsewhere_stmt__end(int numBodyConstructs) {
}
public void end_where_stmt(Token label, Token endKeyword,
Token whereKeyword, Token id, Token eos) {
}
public void forall_construct() {
}
public void forall_construct_stmt(Token label, Token id,
Token forallKeyword, Token eos) {
}
public void forall_header() {
}
public void forall_triplet_spec(Token id, boolean hasStride) {
}
public void forall_triplet_spec_list__begin() {
}
public void forall_triplet_spec_list(int count) {
}
public void forall_body_construct() {
}
public void forall_assignment_stmt(boolean isPointerAssignment) {
}
public void end_forall_stmt(Token label, Token endKeyword,
Token forallKeyword, Token id, Token eos) {
}
public void forall_stmt__begin() {
}
public void forall_stmt(Token label, Token forallKeyword) {
}
/**
* R801
*/
public void block() {
FortranNode temp = null;
FortranNode block_Node = new FortranNode(801, "Block");
while (!stack.isEmpty() && stack.peek().rule() == 213) {
temp = stack.pop();
if (block_Node.numChildren() < 1)
block_Node.addChild(temp);
else
block_Node.addChild(0, temp);
}
stack.push(block_Node);
}
public void if_construct() {
}
public void if_then_stmt(Token label, Token id, Token ifKeyword,
Token thenKeyword, Token eos) {
}
public void else_if_stmt(Token label, Token elseKeyword, Token ifKeyword,
Token thenKeyword, Token id, Token eos) {
}
public void else_stmt(Token label, Token elseKeyword, Token id, Token eos) {
}
public void end_if_stmt(Token label, Token endKeyword, Token ifKeyword,
Token id, Token eos) {
}
/**
* R807 Begin
*/
public void if_stmt__begin() {
// Do nothing
}
/**
* R807 Statement
*/
public void if_stmt(Token label, Token ifKeyword) {
int rule = -1;
FortranNode temp = null;
FortranNode if_stmt_Node = new FortranNode(807, "IfStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode ifKeyword_Node = new FortranNode(-1, "Keyword", ifKeyword);
if_stmt_Node.addChild(label_Node);
if_stmt_Node.addChild(ifKeyword_Node);
assert !stack.isEmpty();
rule = stack.peek().rule();
if (rule == 214) {
temp = stack.pop();
if_stmt_Node.addChild(temp);
assert !stack.isEmpty();
}
temp = stack.pop();
rule = temp.rule();
assert rule == 710 /* Lv3Expr */
|| rule == 714 /* AndOperand */
; // TODO: boolean variable
if_stmt_Node.addChild(2, temp);
stack.push(if_stmt_Node);
}
public void block_construct() {
}
public void specification_part_and_block(int numUseStmts,
int numImportStmts, int numDeclConstructs) {
}
public void block_stmt(Token label, Token id, Token keyword, Token eos) {
}
public void end_block_stmt(Token label, Token id, Token endKeyword,
Token blockKeyword, Token eos) {
}
public void critical_construct() {
}
public void critical_stmt(Token label, Token id, Token keyword, Token eos) {
}
public void end_critical_stmt(Token label, Token id, Token endKeyword,
Token criticalKeyword, Token eos) {
}
public void case_construct() {
}
public void select_case_stmt(Token label, Token id, Token selectKeyword,
Token caseKeyword, Token eos) {
}
public void case_stmt(Token label, Token caseKeyword, Token id, Token eos) {
}
public void end_select_stmt(Token label, Token endKeyword,
Token selectKeyword, Token id, Token eos) {
}
public void case_selector(Token defaultToken) {
}
public void case_value_range() {
}
public void case_value_range_list__begin() {
}
public void case_value_range_list(int count) {
}
public void case_value_range_suffix() {
}
public void case_value() {
}
public void associate_construct() {
}
public void associate_stmt(Token label, Token id, Token associateKeyword,
Token eos) {
}
public void association_list__begin() {
}
public void association_list(int count) {
}
public void association(Token id) {
}
public void selector() {
}
public void end_associate_stmt(Token label, Token endKeyword,
Token associateKeyword, Token id, Token eos) {
}
public void select_type_construct() {
}
public void select_type_stmt(Token label, Token selectConstructName,
Token associateName, Token eos) {
}
public void select_type(Token selectKeyword, Token typeKeyword) {
}
public void type_guard_stmt(Token label, Token typeKeyword,
Token isOrDefaultKeyword, Token selectConstructName, Token eos) {
}
public void end_select_type_stmt(Token label, Token endKeyword,
Token selectKeyword, Token id, Token eos) {
}
/**
* R825
*/
public void do_construct() {
int rule = -1;
FortranNode temp = null;
FortranNode do_construct_Node = new FortranNode(825, "DoConstruct");
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 833;
do_construct_Node.addChild(temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 801;
do_construct_Node.addChild(0, temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 827;
do_construct_Node.addChild(0, temp);
stack.push(do_construct_Node);
}
/**
* R826
*/
public void block_do_construct() {
// Omitted, with R825
}
/**
* R827
*/
public void do_stmt(Token label, Token id, Token doKeyword,
Token digitString, Token eos, boolean hasLoopControl) {
FortranNode temp = null;
FortranNode do_stmt_Node = new FortranNode(827, "DoStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode id_Node = new FortranNode(-1, "ID", id);
FortranNode doKeyword_Node = new FortranNode(-1, "Keyword", doKeyword);
FortranNode digitString_Node = new FortranNode(-1, "DigitString",
digitString);
do_stmt_Node.addChild(label_Node);
do_stmt_Node.addChild(id_Node);
do_stmt_Node.addChild(doKeyword_Node);
do_stmt_Node.addChild(digitString_Node);
if (hasLoopControl) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 818;
do_stmt_Node.addChild(temp);
}
stack.push(do_stmt_Node);
}
public void label_do_stmt(Token label, Token id, Token doKeyword,
Token digitString, Token eos, boolean hasLoopControl) {
}
/**
* R818
*/
public void loop_control(Token keyword, int doConstructType,
boolean hasOptExpr) {
int rule = -1;
FortranNode temp = null;
FortranNode loop_control_Node = new FortranNode(818, "LoopCtrl("
+ doConstructType + ")");
FortranNode keyword_Node = new FortranNode(-1, "Keyword", keyword);
loop_control_Node.addChild(keyword_Node);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701; // TODO:
loop_control_Node.addChild(temp);
if (hasOptExpr) {
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701; // TODO:
loop_control_Node.addChild(1, temp);
}
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 701; // TODO:
loop_control_Node.addChild(1, temp);
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 831; // TODO:
loop_control_Node.addChild(1, temp);
stack.push(loop_control_Node);
}
/**
* R831
*/
public void do_variable(Token id) {
FortranNode do_variable_Node = new FortranNode(831, "DoVariable");
FortranNode id_Node = new FortranNode(-1, "ID", id);
do_variable_Node.addChild(id_Node);
stack.push(do_variable_Node);
}
/**
* R833
*/
public void end_do() {
int rule = -1;
FortranNode temp = null;
FortranNode end_do_Node = new FortranNode(833, "EndDo");
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 834 /* EndDoStmt */
|| rule == 838 /* DoTermActionStmt */
;
end_do_Node.addChild(temp);
stack.push(end_do_Node);
}
/**
* R834
*/
public void end_do_stmt(Token label, Token endKeyword, Token doKeyword,
Token id, Token eos) {
FortranNode end_do_stmt_Node = new FortranNode(834, "EndDoStmt");
FortranNode label_Node = new FortranNode(-1, "Label", label);
FortranNode endKeyword_Node = new FortranNode(-1, "KeywordEnd",
endKeyword);
FortranNode doKeyword_Node = new FortranNode(-1, "KeywordDo", doKeyword);
FortranNode id_Node = new FortranNode(-1, "ID", id);
end_do_stmt_Node.addChild(label_Node);
end_do_stmt_Node.addChild(endKeyword_Node);
end_do_stmt_Node.addChild(doKeyword_Node);
end_do_stmt_Node.addChild(id_Node);
stack.push(end_do_stmt_Node);
}
/**
* R838 1
*/
public void do_term_action_stmt(Token label, Token endKeyword,
Token doKeyword, Token id, Token eos, boolean inserted) {
FortranNode temp = null;
FortranNode do_term_action_stmt_Node = new FortranNode(838,
"DoTermActStmt");
FortranNode label_Node = new FortranNode(-1, "Label", label);
FortranNode endKeyword_Node = new FortranNode(-1, "KeywordEnd",
endKeyword);
FortranNode doKeyword_Node = new FortranNode(-1, "KeywordDo", doKeyword);
FortranNode id_Node = new FortranNode(-1, "ID", id);
do_term_action_stmt_Node.addChild(label_Node);
do_term_action_stmt_Node.addChild(endKeyword_Node);
do_term_action_stmt_Node.addChild(doKeyword_Node);
do_term_action_stmt_Node.addChild(id_Node);
if (inserted) {
assert false;
}
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 214;
do_term_action_stmt_Node.addChild(temp);
stack.push(do_term_action_stmt_Node);
}
public void cycle_stmt(Token label, Token cycleKeyword, Token id, Token eos) {
}
public void exit_stmt(Token label, Token exitKeyword, Token id, Token eos) {
}
/**
* R845
*/
public void goto_stmt(Token label, Token goKeyword, Token toKeyword,
Token target_label, Token eos) {
FortranNode goto_stmt_Node = new FortranNode(845, "GotoStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode goKeyword_Node = new FortranNode(-1, "KeywordGo", goKeyword);
FortranNode toKeyword_Node = new FortranNode(-1, "KeywordTo", toKeyword);
FortranNode target_label_Node = new FortranNode(-1, "LabelRef",
target_label);
goto_stmt_Node.addChild(label_Node);
goto_stmt_Node.addChild(goKeyword_Node);
goto_stmt_Node.addChild(toKeyword_Node);
goto_stmt_Node.addChild(target_label_Node);
stack.push(goto_stmt_Node);
}
public void computed_goto_stmt(Token label, Token goKeyword,
Token toKeyword, Token eos) {
}
public void assign_stmt(Token label1, Token assignKeyword, Token label2,
Token toKeyword, Token name, Token eos) {
}
public void assigned_goto_stmt(Token label, Token goKeyword,
Token toKeyword, Token name, Token eos) {
}
public void stmt_label_list() {
}
public void pause_stmt(Token label, Token pauseKeyword, Token constant,
Token eos) {
}
public void arithmetic_if_stmt(Token label, Token ifKeyword, Token label1,
Token label2, Token label3, Token eos) {
}
/**
* R848
*/
public void continue_stmt(Token label, Token continueKeyword, Token eos) {
FortranNode continue_stmt_Node = new FortranNode(848, "ContinueStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode continueKeyword_Node = new FortranNode(-1, "Keyword",
continueKeyword);
continue_stmt_Node.addChild(label_Node);
continue_stmt_Node.addChild(continueKeyword_Node);
stack.push(continue_stmt_Node);
}
public void stop_stmt(Token label, Token stopKeyword, Token eos,
boolean hasStopCode) {
}
public void stop_code(Token digitString) {
}
public void errorstop_stmt(Token label, Token errorKeyword,
Token stopKeyword, Token eos, boolean hasStopCode) {
}
public void sync_all_stmt(Token label, Token syncKeyword, Token allKeyword,
Token eos, boolean hasSyncStatList) {
}
public void sync_stat(Token syncStat) {
}
public void sync_stat_list__begin() {
}
public void sync_stat_list(int count) {
}
public void sync_images_stmt(Token label, Token syncKeyword,
Token imagesKeyword, Token eos, boolean hasSyncStatList) {
}
public void image_set(Token asterisk, boolean hasIntExpr) {
}
public void sync_memory_stmt(Token label, Token syncKeyword,
Token memoryKeyword, Token eos, boolean hasSyncStatList) {
}
public void lock_stmt(Token label, Token lockKeyword, Token eos,
boolean hasLockStatList) {
}
public void lock_stat(Token acquiredKeyword) {
}
public void lock_stat_list__begin() {
}
public void lock_stat_list(int count) {
}
public void unlock_stmt(Token label, Token unlockKeyword, Token eos,
boolean hasSyncStatList) {
}
public void lock_variable() {
}
public void scalar_char_constant() {
}
public void io_unit() {
}
public void file_unit_number() {
}
public void open_stmt(Token label, Token openKeyword, Token eos) {
}
public void connect_spec(Token id) {
}
public void connect_spec_list__begin() {
}
public void connect_spec_list(int count) {
}
public void close_stmt(Token label, Token closeKeyword, Token eos) {
}
public void close_spec(Token closeSpec) {
}
public void close_spec_list__begin() {
}
public void close_spec_list(int count) {
}
public void read_stmt(Token label, Token readKeyword, Token eos,
boolean hasInputItemList) {
}
public void write_stmt(Token label, Token writeKeyword, Token eos,
boolean hasOutputItemList) {
}
public void print_stmt(Token label, Token printKeyword, Token eos,
boolean hasOutputItemList) {
}
public void io_control_spec(boolean hasExpression, Token keyword,
boolean hasAsterisk) {
}
public void io_control_spec_list__begin() {
}
public void io_control_spec_list(int count) {
}
public void format() {
}
public void input_item() {
}
public void input_item_list__begin() {
}
public void input_item_list(int count) {
}
public void output_item() {
}
public void output_item_list__begin() {
}
public void output_item_list(int count) {
}
public void io_implied_do() {
}
public void io_implied_do_object() {
}
public void io_implied_do_control(boolean hasStride) {
}
public void dtv_type_spec(Token typeKeyword) {
}
public void wait_stmt(Token label, Token waitKeyword, Token eos) {
}
public void wait_spec(Token id) {
}
public void wait_spec_list__begin() {
}
public void wait_spec_list(int count) {
}
public void backspace_stmt(Token label, Token backspaceKeyword, Token eos,
boolean hasPositionSpecList) {
}
public void endfile_stmt(Token label, Token endKeyword, Token fileKeyword,
Token eos, boolean hasPositionSpecList) {
}
public void rewind_stmt(Token label, Token rewindKeyword, Token eos,
boolean hasPositionSpecList) {
}
public void position_spec(Token id) {
}
public void position_spec_list__begin() {
}
public void position_spec_list(int count) {
}
public void flush_stmt(Token label, Token flushKeyword, Token eos,
boolean hasFlushSpecList) {
}
public void flush_spec(Token id) {
}
public void flush_spec_list__begin() {
}
public void flush_spec_list(int count) {
}
public void inquire_stmt(Token label, Token inquireKeyword, Token id,
Token eos, boolean isType2) {
}
public void inquire_spec(Token id) {
}
public void inquire_spec_list__begin() {
}
public void inquire_spec_list(int count) {
}
public void format_stmt(Token label, Token formatKeyword, Token eos) {
}
public void format_specification(boolean hasFormatItemList) {
}
public void format_item(Token descOrDigit, boolean hasFormatItemList) {
}
public void format_item_list__begin() {
}
public void format_item_list(int count) {
}
public void v_list_part(Token plus_minus, Token digitString) {
}
public void v_list__begin() {
}
public void v_list(int count) {
}
/**
* R1101 main program begin
*/
public void main_program__begin() {
// Do nothing
}
/**
* R1101 main program
*/
public void main_program(boolean hasProgramStmt, boolean hasExecutionPart,
boolean hasInternalSubprogramPart) {
int rule = -1;
FortranNode temp = null;
FortranNode main_Node = new FortranNode(1101, "Main");
// EndProgramStmt
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 1103;
main_Node.addChild(temp);
// (InternalSubprogram)
if (hasInternalSubprogramPart) {
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 210;
main_Node.addChild(0, temp);
}
// (ExecutionPart)
if (hasExecutionPart) {
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 208;
main_Node.addChild(0, temp);
}
// SpecificationPart
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 204;
main_Node.addChild(0, temp);
// (ProgramStmt)
if (hasProgramStmt) {
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 1102;
main_Node.addChild(0, temp);
}
// ROOT: Program_Main
root.addChild(main_Node);
}
/**
* R1101 function
*/
public void ext_function_subprogram(boolean hasPrefix) {
FortranNode prefix_Node = null;
FortranNode function_subprogram_Node = null;
assert !stack.isEmpty();
function_subprogram_Node = stack.pop();
assert function_subprogram_Node.rule() == 1223;
if (hasPrefix) {
assert !stack.isEmpty();
prefix_Node = stack.pop();
assert prefix_Node.rule() == 1227;
function_subprogram_Node.getChildByIndex(0)
.addChild(1, prefix_Node);
}
// ROOT: Subprogram_Function
root.addChild(function_subprogram_Node);
}
/**
* R1102 program statement
*/
public void program_stmt(Token label, Token programKeyword, Token id,
Token eos) {
FortranNode prog_stmt_Node = new FortranNode(1102, "ProgramStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode keyword_Node = new FortranNode(-1, "Keyword",
programKeyword);
FortranNode id_Node = new FortranNode(-1, "ID", id);
prog_stmt_Node.addChild(label_Node);
prog_stmt_Node.addChild(keyword_Node);
prog_stmt_Node.addChild(id_Node);
stack.push(prog_stmt_Node);
}
/**
* R1103 end program statement
*/
public void end_program_stmt(Token label, Token endKeyword,
Token programKeyword, Token id, Token eos) {
FortranNode prog_stmt_end_Node = new FortranNode(1103, "EndProgramStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode endKeyword_Node = new FortranNode(-1, "KeywordEnd",
programKeyword);
FortranNode programKeyword_Node = new FortranNode(-1, "KeywordProgram",
programKeyword);
FortranNode id_Node = new FortranNode(-1, "ID", id);
prog_stmt_end_Node.addChild(label_Node);
prog_stmt_end_Node.addChild(endKeyword_Node);
prog_stmt_end_Node.addChild(programKeyword_Node);
prog_stmt_end_Node.addChild(id_Node);
stack.push(prog_stmt_end_Node);
}
public void module() {
}
public void module_stmt__begin() {
}
public void module_stmt(Token label, Token moduleKeyword, Token id,
Token eos) {
}
public void end_module_stmt(Token label, Token endKeyword,
Token moduleKeyword, Token id, Token eos) {
}
public void module_subprogram_part(int count) {
}
public void module_subprogram(boolean hasPrefix) {
}
public void use_stmt(Token label, Token useKeyword, Token id,
Token onlyKeyword, Token eos, boolean hasModuleNature,
boolean hasRenameList, boolean hasOnly) {
}
public void module_nature(Token nature) {
}
public void rename(Token id1, Token id2, Token op1, Token defOp1,
Token op2, Token defOp2) {
}
public void rename_list__begin() {
}
public void rename_list(int count) {
}
public void only(boolean hasGenericSpec, boolean hasRename,
boolean hasOnlyUseName) {
}
public void only_list__begin() {
}
public void only_list(int count) {
}
public void submodule(boolean hasModuleSubprogramPart) {
}
public void submodule_stmt__begin() {
}
public void submodule_stmt(Token label, Token submoduleKeyword, Token name,
Token eos) {
}
public void parent_identifier(Token ancestor, Token parent) {
}
public void end_submodule_stmt(Token label, Token endKeyword,
Token submoduleKeyword, Token name, Token eos) {
}
public void block_data() {
}
public void block_data_stmt__begin() {
}
public void block_data_stmt(Token label, Token blockKeyword,
Token dataKeyword, Token id, Token eos) {
}
public void end_block_data_stmt(Token label, Token endKeyword,
Token blockKeyword, Token dataKeyword, Token id, Token eos) {
}
public void interface_block() {
}
public void interface_specification() {
}
public void interface_stmt__begin() {
}
public void interface_stmt(Token label, Token abstractToken, Token keyword,
Token eos, boolean hasGenericSpec) {
}
public void end_interface_stmt(Token label, Token kw1, Token kw2,
Token eos, boolean hasGenericSpec) {
}
public void interface_body(boolean hasPrefix) {
}
public void procedure_stmt(Token label, Token module,
Token procedureKeyword, Token eos) {
}
public void generic_spec(Token keyword, Token name, int type) {
}
public void dtio_generic_spec(Token rw, Token format, int type) {
}
public void import_stmt(Token label, Token importKeyword, Token eos,
boolean hasGenericNameList) {
}
public void external_stmt(Token label, Token externalKeyword, Token eos) {
}
public void procedure_declaration_stmt(Token label, Token procedureKeyword,
Token eos, boolean hasProcInterface, int count) {
}
public void proc_interface(Token id) {
}
public void proc_attr_spec(Token attrKeyword, Token id, int spec) {
}
public void proc_decl(Token id, boolean hasNullInit) {
}
public void proc_decl_list__begin() {
}
public void proc_decl_list(int count) {
}
public void intrinsic_stmt(Token label, Token intrinsicToken, Token eos) {
}
public void function_reference(boolean hasActualArgSpecList) {
}
public void call_stmt(Token label, Token callKeyword, Token eos,
boolean hasActualArgSpecList) {
}
public void procedure_designator() {
}
public void actual_arg_spec(Token keyword) {
}
public void actual_arg_spec_list__begin() {
}
public void actual_arg_spec_list(int count) {
}
public void actual_arg(boolean hasExpr, Token label) {
}
/**
* R1223
*/
public void function_subprogram(boolean hasExePart, boolean hasIntSubProg) {
int rule = -1;
FortranNode temp = null;
FortranNode function_subprogram_Node = new FortranNode(1223,
"FunctionSubprogram");
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 1230;
function_subprogram_Node.addChild(temp);
if (hasExePart) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 208;
function_subprogram_Node.addChild(0, temp);
}
if (hasIntSubProg) {
assert false;
}
assert !stack.isEmpty();
rule = stack.peek().rule();
if (rule == 204) {
temp = stack.pop();
function_subprogram_Node.addChild(0, temp);
}
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 1224;
function_subprogram_Node.addChild(0, temp);
stack.push(function_subprogram_Node);
}
/**
* R1224
*/
public void function_stmt__begin() {
// Do nothing
}
/**
* R1224
*/
public void function_stmt(Token label, Token keyword, Token name,
Token eos, boolean hasGenericNameList, boolean hasSuffix) {
FortranNode temp = null;
FortranNode function_stmt_Node = new FortranNode(1224, "FunctionStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode keyword_Node = new FortranNode(-1, "Keyword", keyword);
FortranNode name_Node = new FortranNode(-1, "ID", name);
function_stmt_Node.addChild(label_Node);
function_stmt_Node.addChild(keyword_Node);
function_stmt_Node.addChild(name_Node);
if (hasGenericNameList) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 102;
function_stmt_Node.addChild(temp);
}
if (hasSuffix) {
assert false;// TODO:
}
stack.push(function_stmt_Node);
}
public void proc_language_binding_spec() {
}
/**
* R1227
*/
public void prefix(int specCount) {
int counter = specCount;
FortranNode temp = null;
FortranNode prefix_Node = new FortranNode(1227, "Prefix");
while (counter > 0) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 1228;
prefix_Node.addChild(0, temp);
counter--;
}
stack.push(prefix_Node);
}
public void t_prefix(int specCount) {
}
/**
* R1228
*/
public void prefix_spec(boolean isDecTypeSpec) {
FortranNode temp = null;
FortranNode prefix_spec_Node = new FortranNode(1228, "PrefixSpec");
if (isDecTypeSpec) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 502;
prefix_spec_Node.addChild(temp);
} else {
assert false;// TODO:
}
stack.push(prefix_spec_Node);
}
public void t_prefix_spec(Token spec) {
}
public void suffix(Token resultKeyword, boolean hasProcLangBindSpec) {
}
public void result_name() {
}
/**
* R1230
*/
public void end_function_stmt(Token label, Token keyword1, Token keyword2,
Token name, Token eos) {
FortranNode end_function_stmt_Node = new FortranNode(1230,
"EndFunctionStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode keyword1_Node = new FortranNode(-1, "Keyword1", keyword2);
FortranNode keyword2_Node = new FortranNode(-1, "Keyword2", keyword2);
FortranNode name_Node = new FortranNode(-1, "Name", name);
end_function_stmt_Node.addChild(label_Node);
end_function_stmt_Node.addChild(keyword1_Node);
end_function_stmt_Node.addChild(keyword2_Node);
end_function_stmt_Node.addChild(name_Node);
stack.push(end_function_stmt_Node);
}
/**
* R1232
*/
public void subroutine_stmt__begin() {
// Do nothing
}
/**
* R1232
*/
public void subroutine_stmt(Token label, Token keyword, Token name,
Token eos, boolean hasPrefix, boolean hasDummyArgList,
boolean hasBindingSpec, boolean hasArgSpecifier) {
FortranNode temp = null;
FortranNode subroutine_stmt_Node = new FortranNode(1232,
"SubRoutineStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode keyword_Node = new FortranNode(-1, "Keyword", keyword);
FortranNode name_Node = new FortranNode(-1, "ID", name);
subroutine_stmt_Node.addChild(label_Node);
subroutine_stmt_Node.addChild(keyword_Node);
subroutine_stmt_Node.addChild(name_Node);
if (hasPrefix) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 1227;
subroutine_stmt_Node.addChild(1, temp);
}
if (hasDummyArgList) {
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 1233;
subroutine_stmt_Node.addChild(temp);
}
if (hasBindingSpec) {
assert false; // TODO:
}
if (hasArgSpecifier) {
// assert false; // TODO:
}
stack.push(subroutine_stmt_Node);
}
/**
* R1233 Element
*/
public void dummy_arg(Token dummy) {
FortranNode dummy_arg_Node = new FortranNode(1233, "DummyArg", dummy);
stack.push(dummy_arg_Node);
}
/**
* R1233 Begin
*/
public void dummy_arg_list__begin() {
// Do nothing
}
/**
* R1233 List
*/
public void dummy_arg_list(int count) {
int counter = 0;
FortranNode temp = null;
FortranNode dummy_arg_list_Node = new FortranNode(1233, "ArgsList["
+ counter + "]");
counter = count;
while (counter > 0) {
assert !stack.empty();
temp = stack.pop();
assert temp.rule() == 1233;
dummy_arg_list_Node.addChild(0, temp);
counter--;
}
stack.push(dummy_arg_list_Node);
}
/**
* R1234 & R1231
*/
public void end_subroutine_stmt(Token label, Token keyword1,
Token keyword2, Token name, Token eos) {
int rule = -1;
FortranNode temp = null;
FortranNode end_subroutine_stmt_Node = new FortranNode(1234,
"EndSubroutineStmt");
FortranNode subroutine_subprogram_Node = new FortranNode(1231,
"Subroutine");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode keyword1_Node = new FortranNode(-1, "Keyword1", keyword1);
FortranNode keyword2_Node = new FortranNode(-1, "Keyword2", keyword2);
FortranNode name_Node = new FortranNode(-1, "ID", name);
end_subroutine_stmt_Node.addChild(label_Node);
end_subroutine_stmt_Node.addChild(keyword1_Node);
end_subroutine_stmt_Node.addChild(keyword2_Node);
end_subroutine_stmt_Node.addChild(name_Node);
stack.push(end_subroutine_stmt_Node);
// R1231
// EndSubroutineStmt
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 1234;
subroutine_subprogram_Node.addChild(temp);
// (InternalSubprogram)
assert !stack.isEmpty();
rule = stack.peek().rule();
while (rule == 210) {
temp = stack.pop();
subroutine_subprogram_Node.addChild(0, temp);
assert !stack.isEmpty();
rule = stack.peek().rule();
}
// (ExecutionPart)
assert !stack.isEmpty();
rule = stack.peek().rule();
while (rule == 208) {
temp = stack.pop();
subroutine_subprogram_Node.addChild(0, temp);
assert !stack.isEmpty();
rule = stack.peek().rule();
}
// SpecificationPart
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 204;
subroutine_subprogram_Node.addChild(0, temp);
// SubroutineStmt
assert !stack.isEmpty();
temp = stack.pop();
rule = temp.rule();
assert rule == 1232;
subroutine_subprogram_Node.addChild(0, temp);
// ROOT: Subprogram_Subroutine
root.addChild(subroutine_subprogram_Node);
}
public void entry_stmt(Token label, Token keyword, Token id, Token eos,
boolean hasDummyArgList, boolean hasSuffix) {
}
/**
* R1236
*/
public void return_stmt(Token label, Token keyword, Token eos,
boolean hasScalarIntExpr) {
// FortranNode temp = null;
FortranNode return_stmt_Node = new FortranNode(1236, "ReturnStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
return_stmt_Node.addChild(label_Node);
if (hasScalarIntExpr) {
assert false; // TODO:
}
stack.push(return_stmt_Node);
}
public void contains_stmt(Token label, Token keyword, Token eos) {
}
public void separate_module_subprogram(boolean hasExecutionPart,
boolean hasInternalSubprogramPart) {
}
public void separate_module_subprogram__begin() {
}
public void mp_subprogram_stmt(Token label, Token moduleKeyword,
Token procedureKeyword, Token name, Token eos) {
}
public void end_mp_subprogram_stmt(Token label, Token keyword1,
Token keyword2, Token name, Token eos) {
}
public void stmt_function_stmt(Token label, Token functionName, Token eos,
boolean hasGenericNameList) {
}
public void end_of_stmt(Token eos) {
}
/**
* R0
*/
public void start_of_file(String filename, String path) {
FortranNode programe_file_Node = new FortranNode(0, filename);
root = programe_file_Node;
}
/**
* R0
*/
public void end_of_file(String filename, String path) {
System.out.print(root.toString());
}
public void cleanUp() {
}
public void rice_image_selector(Token idTeam) {
}
public void rice_co_dereference_op(Token lbracket, Token rbracket) {
}
public void rice_allocate_coarray_spec(int selection, Token id) {
}
public void rice_co_with_team_stmt(Token label, Token id) {
}
public void rice_end_with_team_stmt(Token label, Token id, Token eos) {
}
public void rice_finish_stmt(Token label, Token idTeam, Token eos) {
}
public void rice_end_finish_stmt(Token label, Token eos) {
}
public void rice_spawn_stmt(Token label, Token spawn, Token eos,
boolean hasEvent) {
}
public void lope_halo_stmt(Token label, Token keyword,
boolean hasHaloBoundarySpec, boolean hasHaloCopyFn, Token eos,
int count) {
}
public void lope_halo_decl(Token id, boolean hasHaloSpec) {
}
public void lope_halo_copy_fn(Token id) {
}
public void lope_halo_spec(int count) {
}
public void lope_halo_spec_element(int type) {
}
public void lope_halo_boundary_spec(int count) {
}
public void lope_halo_boundary_spec_element(int type) {
}
public void lope_exchange_halo_stmt(Token label, Token keyword, Token eos) {
}
public void next_token(Token tk) {
}
/**
* R838 2
*/
@Override
public void do_term_action_stmt(Token label, Token endKeyword,
Token doKeyword, Token id, Token eos) {
FortranNode temp = null;
FortranNode do_term_action_stmt_Node = new FortranNode(838,
"DoTermActStmt");
FortranNode label_Node = new FortranNode(-1, "LabelDef", label);
FortranNode endKeyword_Node = new FortranNode(-1, "Keyword", endKeyword);
FortranNode doKeyword_Node = new FortranNode(-1, "Keyword", doKeyword);
FortranNode id_Node = new FortranNode(-1, "ID", id);
do_term_action_stmt_Node.addChild(label_Node);
do_term_action_stmt_Node.addChild(endKeyword_Node);
do_term_action_stmt_Node.addChild(doKeyword_Node);
do_term_action_stmt_Node.addChild(id_Node);
assert !stack.isEmpty();
temp = stack.pop();
assert temp.rule() == 214;
do_term_action_stmt_Node.addChild(temp);
stack.push(do_term_action_stmt_Node);
}
}