diff --git a/build.sh b/build.sh index 10d0f5f..1c35246 100755 --- a/build.sh +++ b/build.sh @@ -87,7 +87,7 @@ fi status "Installing GhidRust" -sudo rm -f "$GHIDRA"/*GhidRust* 2> /dev/null +sudo rm -f "$GHIDRA"/Extensions/Ghidra/*GhidRust* 2> /dev/null sudo cp dist/* "$GHIDRA"/Extensions/Ghidra if [[ $? -ne 0 ]]; then diff --git a/src/main/java/ghidrust/decompiler/RustDecPlugin.java b/src/main/java/ghidrust/decompiler/RustDecPlugin.java index f99cf60..bdc53fc 100644 --- a/src/main/java/ghidrust/decompiler/RustDecPlugin.java +++ b/src/main/java/ghidrust/decompiler/RustDecPlugin.java @@ -33,7 +33,7 @@ import docking.action.MenuData; //@formatter:off @PluginInfo( - status = PluginStatus.RELEASED, + status = PluginStatus.STABLE, packageName = "HELLO", category = PluginCategoryNames.DECOMPILER, shortDescription = "Rust Decompiler", diff --git a/src/main/java/ghidrust/decompiler/RustDecProvider.java b/src/main/java/ghidrust/decompiler/RustDecProvider.java index abe4921..d0a4c1b 100644 --- a/src/main/java/ghidrust/decompiler/RustDecProvider.java +++ b/src/main/java/ghidrust/decompiler/RustDecProvider.java @@ -14,6 +14,8 @@ import javax.swing.JTextArea; import javax.swing.JToolBar; import javax.swing.JButton; import javax.swing.Box; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; import java.awt.BorderLayout; import java.awt.event.ActionListener; @@ -27,8 +29,6 @@ public class RustDecProvider extends ComponentProvider { private JPanel panel; private JTextArea code_area; private JLabel func_title; - private JToolBar toolbar; - private JButton reload; private Program prog; private Address addr; @@ -56,7 +56,7 @@ public class RustDecProvider extends ComponentProvider { panel = new JPanel(new BorderLayout()); func_title = new JLabel(EMPTY_LABEL); - reload = new JButton(ResourceManager.loadImage("images/reload.png")); + JButton reload = new JButton(ResourceManager.loadImage("images/reload.png")); reload.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -64,15 +64,20 @@ public class RustDecProvider extends ComponentProvider { } }); - toolbar = new JToolBar("GhidRust", JToolBar.HORIZONTAL); + JToolBar toolbar = new JToolBar("GhidRust", JToolBar.HORIZONTAL); + toolbar.setFloatable(false); toolbar.add(func_title); toolbar.add(Box.createHorizontalGlue()); toolbar.add(reload); code_area = new JTextArea(); + code_area.setEditable(false); + + JScrollPane scroll = new JScrollPane(code_area); + scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); panel.add(toolbar, BorderLayout.PAGE_START); - panel.add(code_area); + panel.add(scroll); } public void activateProvider() { diff --git a/src/main/java/ghidrust/decompiler/parser/Run.java b/src/main/java/ghidrust/decompiler/parser/Run.java new file mode 100644 index 0000000..fd2ae8b --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/Run.java @@ -0,0 +1,9 @@ +package ghidrust.decompiler.parser; + +import ghidrust.decompiler.parser.c.gen.CParser; + +public class Run { + public static void main(String[] args) { + System.out.println(CParser.transpile("int main(int a) { int c = 2; return 0; }")); + } +} diff --git a/src/main/java/ghidrust/decompiler/parser/c/CVisitor.java b/src/main/java/ghidrust/decompiler/parser/c/CVisitor.java new file mode 100644 index 0000000..6b1d672 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/CVisitor.java @@ -0,0 +1,338 @@ +package ghidrust.decompiler.parser.c; + +import ghidrust.decompiler.parser.c.gen.*; +import java.util.HashMap; + +/* Generated By:JavaCC: Do not edit this line. CParserDefaultVisitor.java Version 7.0.9 */ +public class CVisitor implements CParserVisitor { + HashMap type_map = new HashMap(); + + int indent_level = 0; + + public CVisitor() { + type_map.put("void", ""); + type_map.put("int", "i32"); + + /* Not entirely true, but works for now */ + type_map.put("char", "char"); + + type_map.put("short", "i16"); + type_map.put("long", "i32"); + type_map.put("float", "f32"); + type_map.put("double", "f64"); + type_map.put("signed", "i32"); + type_map.put("unsigned", "u32"); + type_map.put("code", "code"); + } + + public Object defaultVisit(SimpleNode node, Object data) { + StringBuilder sb = new StringBuilder(""); + + int child_count = node.jjtGetNumChildren(); + for (int i = 0; i < child_count; i++) { + Node child = node.jjtGetChild(i); + String ret = (String) child.jjtAccept(this, data); + if (ret != null) { + sb.append(ret); + } + } + + return sb.toString(); + } + + public Object defaultSpacedVisit(SimpleNode node, Object data) { + StringBuilder sb = new StringBuilder(""); + + int child_count = node.jjtGetNumChildren(); + for (int i = 0; i < child_count; i++) { + Node child = node.jjtGetChild(i); + String ret = (String) child.jjtAccept(this, data); + if (ret != null) { + sb.append(ret); + if (!ret.equals("")) { + sb.append(" "); + } + } + } + + return sb.toString(); + } + + public Object visit(SimpleNode node, Object data) { + return node.jjtAccept(this, data); + } + + public Object visit(ASTStringToken node, Object data) { + return node.getValue(); + } + + public Object visit(ASTGhostStringToken node, Object data) { + return ""; + } + + public Object visit(ASTTypeStringToken node, Object data) { + String typename = node.getValue(); + + if (type_map.containsKey(typename)) { + return type_map.get(typename); + } else { + return typename; + } + } + + public Object visit(ASTFunctionDefinition node, Object data) { + node.dump(""); + StringBuilder rust_code = new StringBuilder(""); + + rust_code.append("fn "); + rust_code.append(node.jjtGetChild(1).jjtAccept(this, data)); + rust_code.append("-> "); + rust_code.append(node.jjtGetChild(0).jjtAccept(this, data)); + rust_code.append(" {\n"); + indent_level++; + rust_code.append(node.jjtGetChild(2).jjtAccept(this, data)); + rust_code.append("\n}\n"); + indent_level--; + + return rust_code.toString(); + } + + public Object visit(ASTDeclaration node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTDeclarationList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTDeclarationSpecifiers node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTInitDeclaratorList node, Object data) { + if (node.jjtGetNumChildren() == 1) { + return node.jjtGetChild(0).jjtAccept(this, data); + } else { + StringBuilder sb = new StringBuilder("&"); + sb.append(node.jjtGetChild(0).jjtAccept(this, data)); + sb.append(node.jjtGetChild(1).jjtAccept(this, data)); + return sb.toString(); + } + } + + public Object visit(ASTInitDeclarator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTSpecifierQualifierList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTDeclarator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTDirectDeclarator node, Object data) { + int child_num = node.jjtGetNumChildren(); + + StringBuilder sb = new StringBuilder(""); + for (int i = 0; i < child_num; i++) { + Node child = node.jjtGetChild(i); + String child_val = (String) child.jjtAccept(this, data); + + if (child instanceof ASTDeclarator || child instanceof ASTParameterTypeList + || child instanceof ASTIdentifierList) { + sb.append("("); + sb.append(child_val); + sb.append(") "); + } else if (child instanceof ASTConstantExpression) { + sb.append("["); + sb.append(child_val); + sb.append("] "); + } else { + sb.append(child_val); + } + } + + return sb.toString(); + } + + public Object visit(ASTPointer node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTTypeQualifierList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTParameterTypeList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTParameterList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTParameterDeclaration node, Object data) { + StringBuilder param = new StringBuilder((String) defaultSpacedVisit(node, data)); + /* Get rid of the trailing space */ + param.setLength(param.length() - 1); + return param.toString(); + } + + public Object visit(ASTIdentifierList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTInitializer node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTInitializerList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTTypeName node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTAbstractDeclarator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTDirectAbstractDeclarator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTLabeledStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTExpressionStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTCompoundStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTStatementList node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTSelectionStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTIterationStatement node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTJumpStatement node, Object data) { + StringBuilder sb = new StringBuilder(""); + for (int i = 0; i < indent_level; i++) { + sb.append("\t"); + } + + if (node.jjtGetNumChildren() == 0 || node.jjtGetChild(0) instanceof ASTExpression) { + sb.append("return "); + sb.append(node.jjtGetChild(0).jjtAccept(this, data)); + sb.append(";"); + } else { + sb.append(defaultVisit(node, data)); + } + return sb.toString(); + } + + public Object visit(ASTExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTAssignmentExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTAssignmentOperator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTConditionalExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTConstantExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTLogicalORExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTLogicalANDExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTInclusiveORExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTExclusiveORExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTANDExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTEqualityExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTRelationalExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTShiftExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTAdditiveExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTMultiplicativeExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTCastExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTUnaryExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTUnaryOperator node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTPostfixExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTPrimaryExpression node, Object data) { + return defaultVisit(node, data); + } + + public Object visit(ASTArgumentExpressionList node, Object data) { + return defaultVisit(node, data); + } +} +/* + * JavaCC - OriginalChecksum=fd39d82df2a1b516298b94d6f4a5e997 (do not edit this + * line) + */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTANDExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTANDExpression.java new file mode 100644 index 0000000..2f8e189 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTANDExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTANDExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTANDExpression extends SimpleNode { + public ASTANDExpression(int id) { + super(id); + } + + public ASTANDExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=7e93c9974e8f2b14420427b910c803b4 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAbstractDeclarator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAbstractDeclarator.java new file mode 100644 index 0000000..2e31d28 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAbstractDeclarator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTAbstractDeclarator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTAbstractDeclarator extends SimpleNode { + public ASTAbstractDeclarator(int id) { + super(id); + } + + public ASTAbstractDeclarator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=3c80989bb20f86b9b8036d71e7bef9c2 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAdditiveExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAdditiveExpression.java new file mode 100644 index 0000000..806ade3 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAdditiveExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTAdditiveExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTAdditiveExpression extends SimpleNode { + public ASTAdditiveExpression(int id) { + super(id); + } + + public ASTAdditiveExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=f71bb1e7a072d878a992f57313d16468 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTArgumentExpressionList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTArgumentExpressionList.java new file mode 100644 index 0000000..8dc65ea --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTArgumentExpressionList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTArgumentExpressionList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTArgumentExpressionList extends SimpleNode { + public ASTArgumentExpressionList(int id) { + super(id); + } + + public ASTArgumentExpressionList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=3d50396a2f3da00f02231d6bf8462c1f (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentExpression.java new file mode 100644 index 0000000..99946b7 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTAssignmentExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTAssignmentExpression extends SimpleNode { + public ASTAssignmentExpression(int id) { + super(id); + } + + public ASTAssignmentExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4e1bb62c278549e39d52bdb3b3ba2d83 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentOperator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentOperator.java new file mode 100644 index 0000000..b917daa --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTAssignmentOperator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTAssignmentOperator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTAssignmentOperator extends SimpleNode { + public ASTAssignmentOperator(int id) { + super(id); + } + + public ASTAssignmentOperator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=12f8178c7ddf074d791222ca3a98afdd (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCastExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCastExpression.java new file mode 100644 index 0000000..e16339c --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCastExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTCastExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTCastExpression extends SimpleNode { + public ASTCastExpression(int id) { + super(id); + } + + public ASTCastExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=5f74743ccea636bb6764ebed2ac163e2 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCompoundStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCompoundStatement.java new file mode 100644 index 0000000..6a16a00 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTCompoundStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTCompoundStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTCompoundStatement extends SimpleNode { + public ASTCompoundStatement(int id) { + super(id); + } + + public ASTCompoundStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=0e0e31b45cd47c4f4461f95fd3e3de78 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConditionalExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConditionalExpression.java new file mode 100644 index 0000000..a97f3bf --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConditionalExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTConditionalExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTConditionalExpression extends SimpleNode { + public ASTConditionalExpression(int id) { + super(id); + } + + public ASTConditionalExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=0abef7756156c947795a60956e579484 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConstantExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConstantExpression.java new file mode 100644 index 0000000..e9b6ce0 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTConstantExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTConstantExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTConstantExpression extends SimpleNode { + public ASTConstantExpression(int id) { + super(id); + } + + public ASTConstantExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=9f5650e6758d6a765d019f16147af60b (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclaration.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclaration.java new file mode 100644 index 0000000..3b77a0f --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclaration.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDeclaration.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDeclaration extends SimpleNode { + public ASTDeclaration(int id) { + super(id); + } + + public ASTDeclaration(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=348ef19493387532712ee3fd63bef963 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationList.java new file mode 100644 index 0000000..e6dcbc9 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDeclarationList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDeclarationList extends SimpleNode { + public ASTDeclarationList(int id) { + super(id); + } + + public ASTDeclarationList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=74a8d1f0be8d1ac35c19038dd28661b6 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationSpecifiers.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationSpecifiers.java new file mode 100644 index 0000000..63d753a --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarationSpecifiers.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDeclarationSpecifiers.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDeclarationSpecifiers extends SimpleNode { + public ASTDeclarationSpecifiers(int id) { + super(id); + } + + public ASTDeclarationSpecifiers(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=2696c846786a5a2eade82856402afbaa (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarator.java new file mode 100644 index 0000000..07f9af5 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDeclarator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDeclarator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDeclarator extends SimpleNode { + public ASTDeclarator(int id) { + super(id); + } + + public ASTDeclarator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=8171a8ae0c9b5d4aed5906caced0fc03 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectAbstractDeclarator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectAbstractDeclarator.java new file mode 100644 index 0000000..9251438 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectAbstractDeclarator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDirectAbstractDeclarator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDirectAbstractDeclarator extends SimpleNode { + public ASTDirectAbstractDeclarator(int id) { + super(id); + } + + public ASTDirectAbstractDeclarator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=73556b7b7bb74f11f30bb99721dd1118 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectDeclarator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectDeclarator.java new file mode 100644 index 0000000..2a7ccf8 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTDirectDeclarator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTDirectDeclarator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTDirectDeclarator extends SimpleNode { + public ASTDirectDeclarator(int id) { + super(id); + } + + public ASTDirectDeclarator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4b709aa773fb5b1aa3770e5a95e3fa10 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTEqualityExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTEqualityExpression.java new file mode 100644 index 0000000..48c8060 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTEqualityExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTEqualityExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTEqualityExpression extends SimpleNode { + public ASTEqualityExpression(int id) { + super(id); + } + + public ASTEqualityExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=aab2519466666944adaf86111afb0582 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExclusiveORExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExclusiveORExpression.java new file mode 100644 index 0000000..6c4792e --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExclusiveORExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTExclusiveORExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTExclusiveORExpression extends SimpleNode { + public ASTExclusiveORExpression(int id) { + super(id); + } + + public ASTExclusiveORExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=6f56922e1bdf9afc2877228247e2891b (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpression.java new file mode 100644 index 0000000..45be80c --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTExpression extends SimpleNode { + public ASTExpression(int id) { + super(id); + } + + public ASTExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=9adff7edeff999906ffb1039a66f050d (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpressionStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpressionStatement.java new file mode 100644 index 0000000..6d12259 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTExpressionStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTExpressionStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTExpressionStatement extends SimpleNode { + public ASTExpressionStatement(int id) { + super(id); + } + + public ASTExpressionStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=1c74fd0cb78ed440334aeeb1769835bf (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTFunctionDefinition.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTFunctionDefinition.java new file mode 100644 index 0000000..9f5bd9b --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTFunctionDefinition.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTFunctionDefinition.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTFunctionDefinition extends SimpleNode { + public ASTFunctionDefinition(int id) { + super(id); + } + + public ASTFunctionDefinition(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=ceed4da5ab63eb8db1c189c0a2b48e1d (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTGhostStringToken.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTGhostStringToken.java new file mode 100644 index 0000000..caad3ed --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTGhostStringToken.java @@ -0,0 +1,33 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTGhostStringToken.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTGhostStringToken extends SimpleNode { + String str_value; + + public ASTGhostStringToken(int id) { + super(id); + } + + public ASTGhostStringToken(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } + + public void setValue(String s) { + value = s; + } + + public String getValue() { + return str_value; + } +} +/* JavaCC - OriginalChecksum=7d91f560265b12b4f437803bcd66b7ba (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIdentifierList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIdentifierList.java new file mode 100644 index 0000000..e6af023 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIdentifierList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTIdentifierList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTIdentifierList extends SimpleNode { + public ASTIdentifierList(int id) { + super(id); + } + + public ASTIdentifierList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4b59a3f78866b6522e8f01a33a7e42ea (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInclusiveORExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInclusiveORExpression.java new file mode 100644 index 0000000..694f14b --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInclusiveORExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTInclusiveORExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTInclusiveORExpression extends SimpleNode { + public ASTInclusiveORExpression(int id) { + super(id); + } + + public ASTInclusiveORExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4be48bfdf235cd5783ba6d95e5f75d7a (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclarator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclarator.java new file mode 100644 index 0000000..d9b9f30 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclarator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTInitDeclarator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTInitDeclarator extends SimpleNode { + public ASTInitDeclarator(int id) { + super(id); + } + + public ASTInitDeclarator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=5a3d91755680a04c5498b43e77500777 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclaratorList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclaratorList.java new file mode 100644 index 0000000..3e0b924 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitDeclaratorList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTInitDeclaratorList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTInitDeclaratorList extends SimpleNode { + public ASTInitDeclaratorList(int id) { + super(id); + } + + public ASTInitDeclaratorList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=a2d08638fd0cf7a82e33e58b0478332a (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializer.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializer.java new file mode 100644 index 0000000..edd4ca4 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializer.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTInitializer.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTInitializer extends SimpleNode { + public ASTInitializer(int id) { + super(id); + } + + public ASTInitializer(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=1e50ef3004d5c30bf923f81791f50da2 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializerList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializerList.java new file mode 100644 index 0000000..0d18470 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTInitializerList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTInitializerList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTInitializerList extends SimpleNode { + public ASTInitializerList(int id) { + super(id); + } + + public ASTInitializerList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=558244df30965162e70057ea29c24a1b (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIterationStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIterationStatement.java new file mode 100644 index 0000000..2bdc886 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTIterationStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTIterationStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTIterationStatement extends SimpleNode { + public ASTIterationStatement(int id) { + super(id); + } + + public ASTIterationStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=7b7c82e89dcb516eca8590537cd9f70a (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTJumpStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTJumpStatement.java new file mode 100644 index 0000000..62c5540 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTJumpStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTJumpStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTJumpStatement extends SimpleNode { + public ASTJumpStatement(int id) { + super(id); + } + + public ASTJumpStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=8f8900c8aee5bbcbce1cd63910a5145a (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLabeledStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLabeledStatement.java new file mode 100644 index 0000000..dc576a5 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLabeledStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTLabeledStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTLabeledStatement extends SimpleNode { + public ASTLabeledStatement(int id) { + super(id); + } + + public ASTLabeledStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=90c945b0f67caa48bc985322079aff53 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalANDExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalANDExpression.java new file mode 100644 index 0000000..6d3a9b4 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalANDExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTLogicalANDExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTLogicalANDExpression extends SimpleNode { + public ASTLogicalANDExpression(int id) { + super(id); + } + + public ASTLogicalANDExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=1d00e1b3f3b5cc84eb240091695aa110 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalORExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalORExpression.java new file mode 100644 index 0000000..9625014 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTLogicalORExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTLogicalORExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTLogicalORExpression extends SimpleNode { + public ASTLogicalORExpression(int id) { + super(id); + } + + public ASTLogicalORExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4b98654445da39285ab465c0e8addd5e (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTMultiplicativeExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTMultiplicativeExpression.java new file mode 100644 index 0000000..be68124 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTMultiplicativeExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTMultiplicativeExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTMultiplicativeExpression extends SimpleNode { + public ASTMultiplicativeExpression(int id) { + super(id); + } + + public ASTMultiplicativeExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=bc0ec0ccb8aa48f86316c0b7a00f830c (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterDeclaration.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterDeclaration.java new file mode 100644 index 0000000..66ed713 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterDeclaration.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTParameterDeclaration.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTParameterDeclaration extends SimpleNode { + public ASTParameterDeclaration(int id) { + super(id); + } + + public ASTParameterDeclaration(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4aebee4940a994d0d51c48c5280f9eb8 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterList.java new file mode 100644 index 0000000..142be95 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTParameterList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTParameterList extends SimpleNode { + public ASTParameterList(int id) { + super(id); + } + + public ASTParameterList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=4df2dd10fe864789b789e1afaa3b1ed1 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterTypeList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterTypeList.java new file mode 100644 index 0000000..99ddb84 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTParameterTypeList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTParameterTypeList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTParameterTypeList extends SimpleNode { + public ASTParameterTypeList(int id) { + super(id); + } + + public ASTParameterTypeList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=2424e97a6a345ef3f2a72b0086086cb7 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPointer.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPointer.java new file mode 100644 index 0000000..a069612 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPointer.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTPointer.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTPointer extends SimpleNode { + public ASTPointer(int id) { + super(id); + } + + public ASTPointer(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=e3d91b51bd9822af624c9f60557bbd98 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPostfixExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPostfixExpression.java new file mode 100644 index 0000000..5b65584 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPostfixExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTPostfixExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTPostfixExpression extends SimpleNode { + public ASTPostfixExpression(int id) { + super(id); + } + + public ASTPostfixExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=921e4951da40bb22d131f8b3ba6a1988 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPrimaryExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPrimaryExpression.java new file mode 100644 index 0000000..a5c8e8b --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTPrimaryExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTPrimaryExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTPrimaryExpression extends SimpleNode { + public ASTPrimaryExpression(int id) { + super(id); + } + + public ASTPrimaryExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=74ddac2af3988d157a1b94a9d821defd (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTRelationalExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTRelationalExpression.java new file mode 100644 index 0000000..3bd5182 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTRelationalExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTRelationalExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTRelationalExpression extends SimpleNode { + public ASTRelationalExpression(int id) { + super(id); + } + + public ASTRelationalExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=819382a46b070e41d5029a3e39fe5a89 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSelectionStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSelectionStatement.java new file mode 100644 index 0000000..6139126 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSelectionStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTSelectionStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTSelectionStatement extends SimpleNode { + public ASTSelectionStatement(int id) { + super(id); + } + + public ASTSelectionStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=1d0effb2de665660bde555051d4eaf39 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTShiftExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTShiftExpression.java new file mode 100644 index 0000000..ca65b9e --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTShiftExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTShiftExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTShiftExpression extends SimpleNode { + public ASTShiftExpression(int id) { + super(id); + } + + public ASTShiftExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=6e6a85bea0361907c843fbe90c9de598 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSpecifierQualifierList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSpecifierQualifierList.java new file mode 100644 index 0000000..b8a819e --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTSpecifierQualifierList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTSpecifierQualifierList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTSpecifierQualifierList extends SimpleNode { + public ASTSpecifierQualifierList(int id) { + super(id); + } + + public ASTSpecifierQualifierList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=7fafbaad1e5888617b5543d24af0d7e3 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatement.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatement.java new file mode 100644 index 0000000..ceae54c --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatement.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTStatement.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTStatement extends SimpleNode { + public ASTStatement(int id) { + super(id); + } + + public ASTStatement(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=c72fe84922519215ac2b49c1d95d7b03 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatementList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatementList.java new file mode 100644 index 0000000..c80581d --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStatementList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTStatementList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTStatementList extends SimpleNode { + public ASTStatementList(int id) { + super(id); + } + + public ASTStatementList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=7d811424c808895d04aa0efe33fefd71 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStringToken.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStringToken.java new file mode 100644 index 0000000..0593741 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTStringToken.java @@ -0,0 +1,33 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTStringToken.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTStringToken extends SimpleNode { + String str_value; + + public ASTStringToken(int id) { + super(id); + } + + public ASTStringToken(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } + + public void setValue(String s) { + str_value = s; + } + + public String getValue() { + return str_value; + } +} +/* JavaCC - OriginalChecksum=c289df07a5b51163b866d4bfab28fb00 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeName.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeName.java new file mode 100644 index 0000000..fca42b2 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeName.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTTypeName.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTTypeName extends SimpleNode { + public ASTTypeName(int id) { + super(id); + } + + public ASTTypeName(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=6649fc4e18b27ff4c36885518a37d22c (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeQualifierList.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeQualifierList.java new file mode 100644 index 0000000..4926797 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeQualifierList.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTTypeQualifierList.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTTypeQualifierList extends SimpleNode { + public ASTTypeQualifierList(int id) { + super(id); + } + + public ASTTypeQualifierList(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=9ed914bbeab9d4fba7337616cdf8c796 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeStringToken.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeStringToken.java new file mode 100644 index 0000000..0eaf5a9 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTTypeStringToken.java @@ -0,0 +1,33 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTTypeStringToken.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTTypeStringToken extends SimpleNode { + String str_value; + + public ASTTypeStringToken(int id) { + super(id); + } + + public ASTTypeStringToken(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } + + public void setValue(String s) { + str_value = s; + } + + public String getValue() { + return str_value; + } +} +/* JavaCC - OriginalChecksum=726f5c0cafc2cba1f5ca608dfd54d3e2 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryExpression.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryExpression.java new file mode 100644 index 0000000..3ed07ef --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryExpression.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTUnaryExpression.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTUnaryExpression extends SimpleNode { + public ASTUnaryExpression(int id) { + super(id); + } + + public ASTUnaryExpression(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=d19d61fd0527008bafedc0dbcae70bec (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryOperator.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryOperator.java new file mode 100644 index 0000000..7deffb1 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ASTUnaryOperator.java @@ -0,0 +1,23 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. ASTUnaryOperator.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class ASTUnaryOperator extends SimpleNode { + public ASTUnaryOperator(int id) { + super(id); + } + + public ASTUnaryOperator(CParser p, int id) { + super(p, id); + } + + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) { + + return + visitor.visit(this, data); + } +} +/* JavaCC - OriginalChecksum=6c43a4b6e42256ad16599f05ce4392a5 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParser.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParser.java new file mode 100644 index 0000000..18fed88 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParser.java @@ -0,0 +1,5171 @@ +package ghidrust.decompiler.parser.c.gen; + +/* CParser.java */ +/* Generated By:JJTree&JavaCC: Do not edit this line. CParser.java */ +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import ghidrust.decompiler.parser.c.CVisitor; + +public class CParser/*@bgen(jjtree)*/implements CParserTreeConstants, CParserConstants {/*@bgen(jjtree)*/ + protected static JJTCParserState jjtree = new JJTCParserState();private static CParser c_parser; + + // Run the parser + public static String transpile(String c_code) { + InputStream stream = new ByteArrayInputStream(c_code.getBytes(StandardCharsets.UTF_8)); + c_parser = new CParser(stream); + + try { + return parse(); + } catch (ParseException e) { + System.out.println("Rust transpiler: Encountered errors during parsing."); + e.printStackTrace(); + return null; + } + } + + public static String parse() throws ParseException { + CParserVisitor visitor = new CVisitor(); + return (String) c_parser.FunctionDefinition().jjtAccept(visitor, null); + } + + static final public SimpleNode FunctionDefinition() throws ParseException {/*@bgen(jjtree) FunctionDefinition */ + ASTFunctionDefinition jjtn000 = new ASTFunctionDefinition(JJTFUNCTIONDEFINITION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_1(2147483647)) { + DeclarationSpecifiers(); + } else { + ; + } + Declarator(); + CompoundStatement(); +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +{if ("" != null) return jjtn000;} + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } + throw new Error("Missing return statement in function"); +} + + static final public void Declaration() throws ParseException {/*@bgen(jjtree) Declaration */ + ASTDeclaration jjtn000 = new ASTDeclaration(JJTDECLARATION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + DeclarationSpecifiers(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER: + case 60: + case 64:{ + InitDeclaratorList(); + break; + } + default: + jj_la1[0] = jj_gen; + ; + } + jj_consume_token(57); + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void DeclarationList() throws ParseException {/*@bgen(jjtree) DeclarationList */ + ASTDeclarationList jjtn000 = new ASTDeclarationList(JJTDECLARATIONLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + label_1: + while (true) { + Declaration(); + if (jj_2_2(2147483647)) { + ; + } else { + break label_1; + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void DeclarationSpecifiers() throws ParseException {/*@bgen(jjtree) DeclarationSpecifiers */ + ASTDeclarationSpecifiers jjtn000 = new ASTDeclarationSpecifiers(JJTDECLARATIONSPECIFIERS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case REGISTER: + case TYPEDEF: + case EXTERN: + case STATIC: + case AUTO:{ + StorageClassSpecifier(); + if (jj_2_3(2147483647)) { + DeclarationSpecifiers(); + } else { + ; + } + break; + } + case UNDEFINED_TYPE: + case UNSIGNED: + case DOUBLE: + case SIGNED: + case FLOAT: + case SHORT: + case LONG: + case VOID: + case CHAR: + case INT: + case CODE:{ + TypeSpecifier(); + if (jj_2_4(2147483647)) { + DeclarationSpecifiers(); + } else { + ; + } + break; + } + case VOLATILE: + case CONST:{ + TypeQualifier(); + if (jj_2_5(2147483647)) { + DeclarationSpecifiers(); + } else { + ; + } + break; + } + default: + jj_la1[1] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void StorageClassSpecifier() throws ParseException {/*@bgen(jjtree) GhostStringToken */ + ASTGhostStringToken jjtn000 = new ASTGhostStringToken(JJTGHOSTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case AUTO:{ + t = jj_consume_token(AUTO); + break; + } + case REGISTER:{ + t = jj_consume_token(REGISTER); + break; + } + case STATIC:{ + t = jj_consume_token(STATIC); + break; + } + case EXTERN:{ + t = jj_consume_token(EXTERN); + break; + } + case TYPEDEF:{ + t = jj_consume_token(TYPEDEF); + break; + } + default: + jj_la1[2] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +jjtn000.setValue(t.image); + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void TypeSpecifier() throws ParseException {/*@bgen(jjtree) TypeStringToken */ + ASTTypeStringToken jjtn000 = new ASTTypeStringToken(JJTTYPESTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case VOID:{ + t = jj_consume_token(VOID); + break; + } + case CHAR:{ + t = jj_consume_token(CHAR); + break; + } + case SHORT:{ + t = jj_consume_token(SHORT); + break; + } + case INT:{ + t = jj_consume_token(INT); + break; + } + case LONG:{ + t = jj_consume_token(LONG); + break; + } + case FLOAT:{ + t = jj_consume_token(FLOAT); + break; + } + case DOUBLE:{ + t = jj_consume_token(DOUBLE); + break; + } + case SIGNED:{ + t = jj_consume_token(SIGNED); + break; + } + case UNSIGNED:{ + t = jj_consume_token(UNSIGNED); + break; + } + case CODE:{ + t = jj_consume_token(CODE); + break; + } + case UNDEFINED_TYPE:{ + t = jj_consume_token(UNDEFINED_TYPE); + break; + } + default: + jj_la1[3] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +jjtn000.setValue(t.image); + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void TypeQualifier() throws ParseException {/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case CONST:{ + t = jj_consume_token(CONST); + break; + } + case VOLATILE:{ + t = jj_consume_token(VOLATILE); + break; + } + default: + jj_la1[4] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +jjtn000.setValue(t.image); + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void InitDeclaratorList() throws ParseException {/*@bgen(jjtree) InitDeclaratorList */ + ASTInitDeclaratorList jjtn000 = new ASTInitDeclaratorList(JJTINITDECLARATORLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + InitDeclarator(); + label_2: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + ; + break; + } + default: + jj_la1[5] = jj_gen; + break label_2; + } + jj_consume_token(58); + InitDeclarator(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void InitDeclarator() throws ParseException {/*@bgen(jjtree) InitDeclarator */ + ASTInitDeclarator jjtn000 = new ASTInitDeclarator(JJTINITDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + Declarator(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 59:{ + jj_consume_token(59); + Initializer(); + break; + } + default: + jj_la1[6] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void SpecifierQualifierList() throws ParseException {/*@bgen(jjtree) SpecifierQualifierList */ + ASTSpecifierQualifierList jjtn000 = new ASTSpecifierQualifierList(JJTSPECIFIERQUALIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case UNDEFINED_TYPE: + case UNSIGNED: + case DOUBLE: + case SIGNED: + case FLOAT: + case SHORT: + case LONG: + case VOID: + case CHAR: + case INT: + case CODE:{ + TypeSpecifier(); + if (jj_2_6(2147483647)) { + SpecifierQualifierList(); + } else { + ; + } + break; + } + case VOLATILE: + case CONST:{ + TypeQualifier(); + if (jj_2_7(2147483647)) { + SpecifierQualifierList(); + } else { + ; + } + break; + } + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Declarator() throws ParseException {/*@bgen(jjtree) Declarator */ + ASTDeclarator jjtn000 = new ASTDeclarator(JJTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 64:{ + Pointer(); + break; + } + default: + jj_la1[8] = jj_gen; + ; + } + DirectDeclarator(); + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void DirectDeclarator() throws ParseException {/*@bgen(jjtree) DirectDeclarator */ + ASTDirectDeclarator jjtn000 = new ASTDirectDeclarator(JJTDIRECTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + Identifier(); + break; + } + case 60:{ + jj_consume_token(60); + Declarator(); + jj_consume_token(61); + break; + } + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + label_3: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62:{ + ; + break; + } + default: + jj_la1[10] = jj_gen; + break label_3; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 62:{ + jj_consume_token(62); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + ConstantExpression(); + break; + } + default: + jj_la1[11] = jj_gen; + ; + } + jj_consume_token(63); + break; + } + default: + jj_la1[13] = jj_gen; + if (jj_2_8(3)) { + jj_consume_token(60); + ParameterTypeList(); + jj_consume_token(61); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60:{ + jj_consume_token(60); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + IdentifierList(); + break; + } + default: + jj_la1[12] = jj_gen; + ; + } + jj_consume_token(61); + break; + } + default: + jj_la1[14] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Pointer() throws ParseException {/*@bgen(jjtree) Pointer */ + ASTPointer jjtn000 = new ASTPointer(JJTPOINTER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + jj_consume_token(64); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case VOLATILE: + case CONST:{ + TypeQualifierList(); + break; + } + default: + jj_la1[15] = jj_gen; + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 64:{ + Pointer(); + break; + } + default: + jj_la1[16] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void TypeQualifierList() throws ParseException {/*@bgen(jjtree) TypeQualifierList */ + ASTTypeQualifierList jjtn000 = new ASTTypeQualifierList(JJTTYPEQUALIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + label_4: + while (true) { + TypeQualifier(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case VOLATILE: + case CONST:{ + ; + break; + } + default: + jj_la1[17] = jj_gen; + break label_4; + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ParameterTypeList() throws ParseException {/*@bgen(jjtree) ParameterTypeList */ + ASTParameterTypeList jjtn000 = new ASTParameterTypeList(JJTPARAMETERTYPELIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ParameterList(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + jj_consume_token(58); + jj_consume_token(65); + break; + } + default: + jj_la1[18] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ParameterList() throws ParseException {/*@bgen(jjtree) ParameterList */ + ASTParameterList jjtn000 = new ASTParameterList(JJTPARAMETERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ParameterDeclaration(); + label_5: + while (true) { + if (jj_2_9(2)) { + ; + } else { + break label_5; + } + jj_consume_token(58); + ParameterDeclaration(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ParameterDeclaration() throws ParseException {/*@bgen(jjtree) ParameterDeclaration */ + ASTParameterDeclaration jjtn000 = new ASTParameterDeclaration(JJTPARAMETERDECLARATION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + DeclarationSpecifiers(); + if (jj_2_10(2147483647)) { + Declarator(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62: + case 64:{ + AbstractDeclarator(); + break; + } + default: + jj_la1[19] = jj_gen; + ; + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void IdentifierList() throws ParseException {/*@bgen(jjtree) IdentifierList */ + ASTIdentifierList jjtn000 = new ASTIdentifierList(JJTIDENTIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + Identifier(); + label_6: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + ; + break; + } + default: + jj_la1[20] = jj_gen; + break label_6; + } + jj_consume_token(58); + Identifier(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Initializer() throws ParseException {/*@bgen(jjtree) Initializer */ + ASTInitializer jjtn000 = new ASTInitializer(JJTINITIALIZER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + AssignmentExpression(); + break; + } + case 66:{ + jj_consume_token(66); + InitializerList(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + jj_consume_token(58); + break; + } + default: + jj_la1[21] = jj_gen; + ; + } + jj_consume_token(67); + break; + } + default: + jj_la1[22] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void InitializerList() throws ParseException {/*@bgen(jjtree) InitializerList */ + ASTInitializerList jjtn000 = new ASTInitializerList(JJTINITIALIZERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + Initializer(); + label_7: + while (true) { + if (jj_2_11(2)) { + ; + } else { + break label_7; + } + jj_consume_token(58); + Initializer(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void TypeName() throws ParseException {/*@bgen(jjtree) TypeName */ + ASTTypeName jjtn000 = new ASTTypeName(JJTTYPENAME); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + SpecifierQualifierList(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62: + case 64:{ + AbstractDeclarator(); + break; + } + default: + jj_la1[23] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void AbstractDeclarator() throws ParseException {/*@bgen(jjtree) AbstractDeclarator */ + ASTAbstractDeclarator jjtn000 = new ASTAbstractDeclarator(JJTABSTRACTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_12(3)) { + Pointer(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62: + case 64:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 64:{ + Pointer(); + break; + } + default: + jj_la1[24] = jj_gen; + ; + } + DirectAbstractDeclarator(); + break; + } + default: + jj_la1[25] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void DirectAbstractDeclarator() throws ParseException {/*@bgen(jjtree) DirectAbstractDeclarator */ + ASTDirectAbstractDeclarator jjtn000 = new ASTDirectAbstractDeclarator(JJTDIRECTABSTRACTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_13(2)) { + jj_consume_token(60); + AbstractDeclarator(); + jj_consume_token(61); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 62:{ + jj_consume_token(62); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + ConstantExpression(); + break; + } + default: + jj_la1[26] = jj_gen; + ; + } + jj_consume_token(63); + break; + } + case 60:{ + jj_consume_token(60); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE:{ + ParameterTypeList(); + break; + } + default: + jj_la1[27] = jj_gen; + ; + } + jj_consume_token(61); + break; + } + default: + jj_la1[28] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + label_8: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62:{ + ; + break; + } + default: + jj_la1[29] = jj_gen; + break label_8; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 62:{ + jj_consume_token(62); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + ConstantExpression(); + break; + } + default: + jj_la1[30] = jj_gen; + ; + } + jj_consume_token(63); + break; + } + case 60:{ + jj_consume_token(60); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE:{ + ParameterTypeList(); + break; + } + default: + jj_la1[31] = jj_gen; + ; + } + jj_consume_token(61); + break; + } + default: + jj_la1[32] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Statement() throws ParseException {/*@bgen(jjtree) Statement */ + ASTStatement jjtn000 = new ASTStatement(JJTSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_14(2)) { + LabeledStatement(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 57: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + ExpressionStatement(); + break; + } + case 66:{ + CompoundStatement(); + break; + } + case SWITCH: + case IF:{ + SelectionStatement(); + break; + } + case WHILE: + case FOR: + case DO:{ + IterationStatement(); + break; + } + case CONTINUE: + case RETURN: + case BREAK: + case GOTO:{ + JumpStatement(); + break; + } + default: + jj_la1[33] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void LabeledStatement() throws ParseException {/*@bgen(jjtree) LabeledStatement */ + ASTLabeledStatement jjtn000 = new ASTLabeledStatement(JJTLABELEDSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + Identifier(); + jj_consume_token(68); + Statement(); + break; + } + case CASE:{ + jj_consume_token(CASE); + ConstantExpression(); + jj_consume_token(68); + Statement(); + break; + } + case DFLT:{ + jj_consume_token(DFLT); + jj_consume_token(68); + Statement(); + break; + } + default: + jj_la1[34] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ExpressionStatement() throws ParseException {/*@bgen(jjtree) ExpressionStatement */ + ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + Expression(); + break; + } + default: + jj_la1[35] = jj_gen; + ; + } + jj_consume_token(57); + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void CompoundStatement() throws ParseException {/*@bgen(jjtree) CompoundStatement */ + ASTCompoundStatement jjtn000 = new ASTCompoundStatement(JJTCOMPOUNDSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + jj_consume_token(66); + if (jj_2_15(2147483647)) { + DeclarationList(); + } else { + ; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case CONTINUE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DFLT: + case DOUBLE: + case SIZEOF: + case SWITCH: + case RETURN: + case EXTERN: + case STATIC: + case SIGNED: + case WHILE: + case BREAK: + case CONST: + case FLOAT: + case SHORT: + case CASE: + case LONG: + case AUTO: + case VOID: + case CHAR: + case GOTO: + case FOR: + case INT: + case IF: + case DO: + case CODE: + case IDENTIFIER: + case 57: + case 60: + case 64: + case 66: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + StatementList(); + break; + } + default: + jj_la1[36] = jj_gen; + ; + } + jj_consume_token(67); + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void StatementList() throws ParseException {/*@bgen(jjtree) StatementList */ + ASTStatementList jjtn000 = new ASTStatementList(JJTSTATEMENTLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + label_9: + while (true) { + Statement(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case CONTINUE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DFLT: + case DOUBLE: + case SIZEOF: + case SWITCH: + case RETURN: + case EXTERN: + case STATIC: + case SIGNED: + case WHILE: + case BREAK: + case CONST: + case FLOAT: + case SHORT: + case CASE: + case LONG: + case AUTO: + case VOID: + case CHAR: + case GOTO: + case FOR: + case INT: + case IF: + case DO: + case CODE: + case IDENTIFIER: + case 57: + case 60: + case 64: + case 66: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + ; + break; + } + default: + jj_la1[37] = jj_gen; + break label_9; + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void SelectionStatement() throws ParseException {/*@bgen(jjtree) SelectionStatement */ + ASTSelectionStatement jjtn000 = new ASTSelectionStatement(JJTSELECTIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IF:{ + jj_consume_token(IF); + jj_consume_token(60); + Expression(); + jj_consume_token(61); + Statement(); + if (jj_2_16(2)) { + jj_consume_token(ELSE); + Statement(); + } else { + ; + } + break; + } + case SWITCH:{ + jj_consume_token(SWITCH); + jj_consume_token(60); + Expression(); + jj_consume_token(61); + Statement(); + break; + } + default: + jj_la1[38] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void IterationStatement() throws ParseException {/*@bgen(jjtree) IterationStatement */ + ASTIterationStatement jjtn000 = new ASTIterationStatement(JJTITERATIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case WHILE:{ + jj_consume_token(WHILE); + jj_consume_token(60); + Expression(); + jj_consume_token(61); + Statement(); + break; + } + case DO:{ + jj_consume_token(DO); + Statement(); + jj_consume_token(WHILE); + jj_consume_token(60); + Expression(); + jj_consume_token(61); + jj_consume_token(57); + break; + } + case FOR:{ + jj_consume_token(FOR); + jj_consume_token(60); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + Expression(); + break; + } + default: + jj_la1[39] = jj_gen; + ; + } + jj_consume_token(57); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + Expression(); + break; + } + default: + jj_la1[40] = jj_gen; + ; + } + jj_consume_token(57); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + Expression(); + break; + } + default: + jj_la1[41] = jj_gen; + ; + } + jj_consume_token(61); + Statement(); + break; + } + default: + jj_la1[42] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void JumpStatement() throws ParseException {/*@bgen(jjtree) JumpStatement */ + ASTJumpStatement jjtn000 = new ASTJumpStatement(JJTJUMPSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case GOTO:{ + jj_consume_token(GOTO); + Identifier(); + jj_consume_token(57); + break; + } + case CONTINUE:{ + jj_consume_token(CONTINUE); + jj_consume_token(57); + break; + } + case BREAK:{ + jj_consume_token(BREAK); + jj_consume_token(57); + break; + } + case RETURN:{ + jj_consume_token(RETURN); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case SIZEOF: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + Expression(); + break; + } + default: + jj_la1[43] = jj_gen; + ; + } + jj_consume_token(57); + break; + } + default: + jj_la1[44] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Expression() throws ParseException {/*@bgen(jjtree) Expression */ + ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + AssignmentExpression(); + label_10: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + ; + break; + } + default: + jj_la1[45] = jj_gen; + break label_10; + } + jj_consume_token(58); + AssignmentExpression(); + } + break; + } + case UNDEFINED_TYPE: + case VOLATILE: + case REGISTER: + case UNSIGNED: + case TYPEDEF: + case DOUBLE: + case EXTERN: + case STATIC: + case SIGNED: + case CONST: + case FLOAT: + case SHORT: + case LONG: + case AUTO: + case VOID: + case CHAR: + case INT: + case CODE:{ + DeclarationSpecifiers(); + InitDeclaratorList(); + break; + } + default: + jj_la1[46] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void AssignmentExpression() throws ParseException {/*@bgen(jjtree) AssignmentExpression */ + ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_17(2147483647)) { + UnaryExpression(); + AssignmentOperator(); + AssignmentExpression(); + } else if (jj_2_18(3)) { + ConditionalExpression(); + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void AssignmentOperator() throws ParseException {/*@bgen(jjtree) AssignmentOperator */ + ASTAssignmentOperator jjtn000 = new ASTAssignmentOperator(JJTASSIGNMENTOPERATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 59:{ + jj_consume_token(59); + break; + } + case 69:{ + jj_consume_token(69); + break; + } + case 70:{ + jj_consume_token(70); + break; + } + case 71:{ + jj_consume_token(71); + break; + } + case 72:{ + jj_consume_token(72); + break; + } + case 73:{ + jj_consume_token(73); + break; + } + case 74:{ + jj_consume_token(74); + break; + } + case 75:{ + jj_consume_token(75); + break; + } + case 76:{ + jj_consume_token(76); + break; + } + case 77:{ + jj_consume_token(77); + break; + } + case 78:{ + jj_consume_token(78); + break; + } + default: + jj_la1[47] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ConditionalExpression() throws ParseException {/*@bgen(jjtree) ConditionalExpression */ + ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + LogicalORExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 79:{ + jj_consume_token(79); + Expression(); + jj_consume_token(68); + ConditionalExpression(); + break; + } + default: + jj_la1[48] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ConstantExpression() throws ParseException {/*@bgen(jjtree) ConstantExpression */ + ASTConstantExpression jjtn000 = new ASTConstantExpression(JJTCONSTANTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ConditionalExpression(); + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void LogicalORExpression() throws ParseException {/*@bgen(jjtree) LogicalORExpression */ + ASTLogicalORExpression jjtn000 = new ASTLogicalORExpression(JJTLOGICALOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + LogicalANDExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 80:{ + jj_consume_token(80); + LogicalORExpression(); + break; + } + default: + jj_la1[49] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void LogicalANDExpression() throws ParseException {/*@bgen(jjtree) LogicalANDExpression */ + ASTLogicalANDExpression jjtn000 = new ASTLogicalANDExpression(JJTLOGICALANDEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + InclusiveORExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 81:{ + jj_consume_token(81); + LogicalANDExpression(); + break; + } + default: + jj_la1[50] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void InclusiveORExpression() throws ParseException {/*@bgen(jjtree) InclusiveORExpression */ + ASTInclusiveORExpression jjtn000 = new ASTInclusiveORExpression(JJTINCLUSIVEOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ExclusiveORExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 82:{ + jj_consume_token(82); + InclusiveORExpression(); + break; + } + default: + jj_la1[51] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ExclusiveORExpression() throws ParseException {/*@bgen(jjtree) ExclusiveORExpression */ + ASTExclusiveORExpression jjtn000 = new ASTExclusiveORExpression(JJTEXCLUSIVEOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ANDExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 83:{ + jj_consume_token(83); + ExclusiveORExpression(); + break; + } + default: + jj_la1[52] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ANDExpression() throws ParseException {/*@bgen(jjtree) ANDExpression */ + ASTANDExpression jjtn000 = new ASTANDExpression(JJTANDEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + EqualityExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 84:{ + jj_consume_token(84); + ANDExpression(); + break; + } + default: + jj_la1[53] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void EqualityExpression() throws ParseException {/*@bgen(jjtree) EqualityExpression */ + ASTEqualityExpression jjtn000 = new ASTEqualityExpression(JJTEQUALITYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + RelationalExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 85: + case 86:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 85:{ + jj_consume_token(85); + break; + } + case 86:{ + jj_consume_token(86); + break; + } + default: + jj_la1[54] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + EqualityExpression(); + break; + } + default: + jj_la1[55] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void RelationalExpression() throws ParseException {/*@bgen(jjtree) RelationalExpression */ + ASTRelationalExpression jjtn000 = new ASTRelationalExpression(JJTRELATIONALEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + ShiftExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 87: + case 88: + case 89: + case 90:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 87:{ + jj_consume_token(87); + break; + } + case 88:{ + jj_consume_token(88); + break; + } + case 89:{ + jj_consume_token(89); + break; + } + case 90:{ + jj_consume_token(90); + break; + } + default: + jj_la1[56] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + RelationalExpression(); + break; + } + default: + jj_la1[57] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ShiftExpression() throws ParseException {/*@bgen(jjtree) ShiftExpression */ + ASTShiftExpression jjtn000 = new ASTShiftExpression(JJTSHIFTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + AdditiveExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 91: + case 92:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 91:{ + jj_consume_token(91); + break; + } + case 92:{ + jj_consume_token(92); + break; + } + default: + jj_la1[58] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ShiftExpression(); + break; + } + default: + jj_la1[59] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void AdditiveExpression() throws ParseException {/*@bgen(jjtree) AdditiveExpression */ + ASTAdditiveExpression jjtn000 = new ASTAdditiveExpression(JJTADDITIVEEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + MultiplicativeExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 93: + case 94:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 93:{ + jj_consume_token(93); + break; + } + case 94:{ + jj_consume_token(94); + break; + } + default: + jj_la1[60] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + AdditiveExpression(); + break; + } + default: + jj_la1[61] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void MultiplicativeExpression() throws ParseException {/*@bgen(jjtree) MultiplicativeExpression */ + ASTMultiplicativeExpression jjtn000 = new ASTMultiplicativeExpression(JJTMULTIPLICATIVEEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + CastExpression(); + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 64: + case 95: + case 96:{ + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 64:{ + jj_consume_token(64); + break; + } + case 95:{ + jj_consume_token(95); + break; + } + case 96:{ + jj_consume_token(96); + break; + } + default: + jj_la1[62] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + MultiplicativeExpression(); + break; + } + default: + jj_la1[63] = jj_gen; + ; + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void CastExpression() throws ParseException {/*@bgen(jjtree) CastExpression */ + ASTCastExpression jjtn000 = new ASTCastExpression(JJTCASTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_19(2147483647)) { + jj_consume_token(60); + TypeName(); + jj_consume_token(61); + CastExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case SIZEOF: + case IDENTIFIER: + case 60: + case 64: + case 84: + case 93: + case 94: + case 97: + case 98: + case 99: + case 100:{ + UnaryExpression(); + break; + } + default: + jj_la1[64] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void UnaryExpression() throws ParseException {/*@bgen(jjtree) UnaryExpression */ + ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + if (jj_2_21(3)) { + PostfixExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 97:{ + jj_consume_token(97); + UnaryExpression(); + break; + } + case 98:{ + jj_consume_token(98); + UnaryExpression(); + break; + } + case 64: + case 84: + case 93: + case 94: + case 99: + case 100:{ + UnaryOperator(); + CastExpression(); + break; + } + case SIZEOF:{ + jj_consume_token(SIZEOF); + if (jj_2_20(2147483647)) { + UnaryExpression(); + } else { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60:{ + jj_consume_token(60); + TypeName(); + jj_consume_token(61); + break; + } + default: + jj_la1[65] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + } + default: + jj_la1[66] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void UnaryOperator() throws ParseException {/*@bgen(jjtree) UnaryOperator */ + ASTUnaryOperator jjtn000 = new ASTUnaryOperator(JJTUNARYOPERATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 84:{ + jj_consume_token(84); + break; + } + case 64:{ + jj_consume_token(64); + break; + } + case 93:{ + jj_consume_token(93); + break; + } + case 94:{ + jj_consume_token(94); + break; + } + case 99:{ + jj_consume_token(99); + break; + } + case 100:{ + jj_consume_token(100); + break; + } + default: + jj_la1[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void PostfixExpression() throws ParseException {/*@bgen(jjtree) PostfixExpression */ + ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + PrimaryExpression(); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 60: + case 62: + case 97: + case 98: + case 101: + case 102:{ + ; + break; + } + default: + jj_la1[68] = jj_gen; + break label_11; + } + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 62:{ + jj_consume_token(62); + Expression(); + jj_consume_token(63); + break; + } + case 60:{ + jj_consume_token(60); + if (jj_2_22(2147483647)) { + ArgumentExpressionList(); + } else { + ; + } + jj_consume_token(61); + break; + } + case 101:{ + jj_consume_token(101); + Identifier(); + break; + } + case 102:{ + jj_consume_token(102); + Identifier(); + break; + } + case 97:{ + jj_consume_token(97); + break; + } + case 98:{ + jj_consume_token(98); + break; + } + default: + jj_la1[69] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void PrimaryExpression() throws ParseException {/*@bgen(jjtree) PrimaryExpression */ + ASTPrimaryExpression jjtn000 = new ASTPrimaryExpression(JJTPRIMARYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case IDENTIFIER:{ + Identifier(); + break; + } + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL:{ + Constant(); + break; + } + case 60:{ + jj_consume_token(60); + Expression(); + jj_consume_token(61); + break; + } + default: + jj_la1[70] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void ArgumentExpressionList() throws ParseException {/*@bgen(jjtree) ArgumentExpressionList */ + ASTArgumentExpressionList jjtn000 = new ASTArgumentExpressionList(JJTARGUMENTEXPRESSIONLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + AssignmentExpression(); + label_12: + while (true) { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 58:{ + ; + break; + } + default: + jj_la1[71] = jj_gen; + break label_12; + } + jj_consume_token(58); + AssignmentExpression(); + } + } catch (Throwable jjte000) { +if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Identifier() throws ParseException {/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; + try { + t = jj_consume_token(IDENTIFIER); +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +jjtn000.setValue(t.image); + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static final public void Constant() throws ParseException {/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000);Token t; + try { + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case INTEGER_LITERAL:{ + t = jj_consume_token(INTEGER_LITERAL); + break; + } + case FLOATING_POINT_LITERAL:{ + t = jj_consume_token(FLOATING_POINT_LITERAL); + break; + } + case CHARACTER_LITERAL:{ + t = jj_consume_token(CHARACTER_LITERAL); + break; + } + case STRING_LITERAL:{ + t = jj_consume_token(STRING_LITERAL); + break; + } + default: + jj_la1[72] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } +jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; +jjtn000.setValue(t.image); + } finally { +if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +} + + static private boolean jj_2_1(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_1()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + static private boolean jj_2_2(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_2()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + static private boolean jj_2_3(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_3()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + static private boolean jj_2_4(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_4()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } + } + + static private boolean jj_2_5(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_5()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } + } + + static private boolean jj_2_6(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_6()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } + } + + static private boolean jj_2_7(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_7()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(6, xla); } + } + + static private boolean jj_2_8(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_8()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } + } + + static private boolean jj_2_9(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_9()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(8, xla); } + } + + static private boolean jj_2_10(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_10()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(9, xla); } + } + + static private boolean jj_2_11(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_11()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(10, xla); } + } + + static private boolean jj_2_12(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_12()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(11, xla); } + } + + static private boolean jj_2_13(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_13()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(12, xla); } + } + + static private boolean jj_2_14(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_14()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(13, xla); } + } + + static private boolean jj_2_15(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_15()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(14, xla); } + } + + static private boolean jj_2_16(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_16()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(15, xla); } + } + + static private boolean jj_2_17(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_17()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(16, xla); } + } + + static private boolean jj_2_18(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_18()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(17, xla); } + } + + static private boolean jj_2_19(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_19()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(18, xla); } + } + + static private boolean jj_2_20(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_20()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(19, xla); } + } + + static private boolean jj_2_21(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_21()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(20, xla); } + } + + static private boolean jj_2_22(int xla) + { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return (!jj_3_22()); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(21, xla); } + } + + static private boolean jj_3R_LogicalANDExpression_372_9_93() + { + if (jj_3R_InclusiveORExpression_377_9_123()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_LogicalANDExpression_372_35_124()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_LogicalORExpression_367_9_59() + { + if (jj_3R_LogicalANDExpression_372_9_93()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_LogicalORExpression_367_34_94()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_Expression_341_34_140() + { + if (jj_scan_token(58)) return true; + if (jj_3R_AssignmentExpression_346_9_66()) return true; + return false; + } + + static private boolean jj_3_16() + { + if (jj_scan_token(ELSE)) return true; + if (jj_3R_Statement_286_9_24()) return true; + return false; + } + + static private boolean jj_3R_ConstantExpression_362_9_84() + { + if (jj_3R_ConditionalExpression_357_9_27()) return true; + return false; + } + + static private boolean jj_3R_ConditionalExpression_357_9_27() + { + if (jj_3R_LogicalORExpression_367_9_59()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ConditionalExpression_357_33_60()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3_17() + { + if (jj_3R_UnaryExpression_423_9_25()) return true; + if (jj_3R_AssignmentOperator_352_9_26()) return true; + return false; + } + + static private boolean jj_3R_AssignmentOperator_352_9_26() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(59)) { + jj_scanpos = xsp; + if (jj_scan_token(69)) { + jj_scanpos = xsp; + if (jj_scan_token(70)) { + jj_scanpos = xsp; + if (jj_scan_token(71)) { + jj_scanpos = xsp; + if (jj_scan_token(72)) { + jj_scanpos = xsp; + if (jj_scan_token(73)) { + jj_scanpos = xsp; + if (jj_scan_token(74)) { + jj_scanpos = xsp; + if (jj_scan_token(75)) { + jj_scanpos = xsp; + if (jj_scan_token(76)) { + jj_scanpos = xsp; + if (jj_scan_token(77)) { + jj_scanpos = xsp; + if (jj_scan_token(78)) return true; + } + } + } + } + } + } + } + } + } + } + return false; + } + + static private boolean jj_3_18() + { + if (jj_3R_ConditionalExpression_357_9_27()) return true; + return false; + } + + static private boolean jj_3R_AssignmentExpression_346_9_66() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_AssignmentExpression_346_9_103()) { + jj_scanpos = xsp; + if (jj_3_18()) return true; + } + return false; + } + + static private boolean jj_3R_AssignmentExpression_346_9_103() + { + if (jj_3R_UnaryExpression_423_9_25()) return true; + if (jj_3R_AssignmentOperator_352_9_26()) return true; + if (jj_3R_AssignmentExpression_346_9_66()) return true; + return false; + } + + static private boolean jj_3R_Expression_341_9_95() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_Expression_341_9_125()) { + jj_scanpos = xsp; + if (jj_3R_Expression_341_66_126()) return true; + } + return false; + } + + static private boolean jj_3R_Expression_341_9_125() + { + if (jj_3R_AssignmentExpression_346_9_66()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_Expression_341_34_140()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_JumpStatement_336_9_122() + { + if (jj_scan_token(RETURN)) return true; + return false; + } + + static private boolean jj_3R_JumpStatement_333_11_119() + { + if (jj_scan_token(GOTO)) return true; + return false; + } + + static private boolean jj_3R_JumpStatement_335_9_121() + { + if (jj_scan_token(BREAK)) return true; + return false; + } + + static private boolean jj_3R_JumpStatement_334_9_120() + { + if (jj_scan_token(CONTINUE)) return true; + return false; + } + + static private boolean jj_3R_JumpStatement_333_9_89() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_JumpStatement_333_11_119()) { + jj_scanpos = xsp; + if (jj_3R_JumpStatement_334_9_120()) { + jj_scanpos = xsp; + if (jj_3R_JumpStatement_335_9_121()) { + jj_scanpos = xsp; + if (jj_3R_JumpStatement_336_9_122()) return true; + } + } + } + return false; + } + + static private boolean jj_3R_IterationStatement_326_11_116() + { + if (jj_scan_token(WHILE)) return true; + return false; + } + + static private boolean jj_3R_IterationStatement_328_9_118() + { + if (jj_scan_token(FOR)) return true; + return false; + } + + static private boolean jj_3R_IterationStatement_327_9_117() + { + if (jj_scan_token(DO)) return true; + return false; + } + + static private boolean jj_3R_IterationStatement_326_9_88() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_IterationStatement_326_11_116()) { + jj_scanpos = xsp; + if (jj_3R_IterationStatement_327_9_117()) { + jj_scanpos = xsp; + if (jj_3R_IterationStatement_328_9_118()) return true; + } + } + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_281_52_152() + { + if (jj_3R_ParameterTypeList_234_9_16()) return true; + return false; + } + + static private boolean jj_3_15() + { + if (jj_3R_DeclarationList_144_9_23()) return true; + return false; + } + + static private boolean jj_3R_SelectionStatement_320_11_114() + { + if (jj_scan_token(IF)) return true; + return false; + } + + static private boolean jj_3R_SelectionStatement_321_9_115() + { + if (jj_scan_token(SWITCH)) return true; + return false; + } + + static private boolean jj_3R_SelectionStatement_320_9_87() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_SelectionStatement_320_11_114()) { + jj_scanpos = xsp; + if (jj_3R_SelectionStatement_321_9_115()) return true; + } + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_281_46_147() + { + if (jj_scan_token(60)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_281_52_152()) jj_scanpos = xsp; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_ParameterDeclaration_244_76_130() + { + if (jj_3R_AbstractDeclarator_271_9_21()) return true; + return false; + } + + static private boolean jj_3R_ParameterDeclaration_244_74_107() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ParameterDeclaration_244_76_130()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_CompoundStatement_308_9_86() + { + if (jj_scan_token(66)) return true; + return false; + } + + static private boolean jj_3R_ExpressionStatement_303_11_113() + { + if (jj_3R_Expression_341_9_95()) return true; + return false; + } + + static private boolean jj_3R_ExpressionStatement_303_9_85() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ExpressionStatement_303_11_113()) jj_scanpos = xsp; + if (jj_scan_token(57)) return true; + return false; + } + + static private boolean jj_3R_LabeledStatement_298_9_48() + { + if (jj_scan_token(DFLT)) return true; + if (jj_scan_token(68)) return true; + return false; + } + + static private boolean jj_3R_LabeledStatement_296_11_46() + { + if (jj_3R_Identifier_462_9_83()) return true; + if (jj_scan_token(68)) return true; + return false; + } + + static private boolean jj_3R_LabeledStatement_297_9_47() + { + if (jj_scan_token(CASE)) return true; + if (jj_3R_ConstantExpression_362_9_84()) return true; + return false; + } + + static private boolean jj_3R_LabeledStatement_296_9_22() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_LabeledStatement_296_11_46()) { + jj_scanpos = xsp; + if (jj_3R_LabeledStatement_297_9_47()) { + jj_scanpos = xsp; + if (jj_3R_LabeledStatement_298_9_48()) return true; + } + } + return false; + } + + static private boolean jj_3R_TypeName_265_36_61() + { + if (jj_3R_AbstractDeclarator_271_9_21()) return true; + return false; + } + + static private boolean jj_3R_Statement_291_9_54() + { + if (jj_3R_JumpStatement_333_9_89()) return true; + return false; + } + + static private boolean jj_3R_Statement_290_9_53() + { + if (jj_3R_IterationStatement_326_9_88()) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_281_17_151() + { + if (jj_3R_ConstantExpression_362_9_84()) return true; + return false; + } + + static private boolean jj_3R_Statement_289_9_52() + { + if (jj_3R_SelectionStatement_320_9_87()) return true; + return false; + } + + static private boolean jj_3R_Statement_288_9_51() + { + if (jj_3R_CompoundStatement_308_9_86()) return true; + return false; + } + + static private boolean jj_3_14() + { + if (jj_3R_LabeledStatement_296_9_22()) return true; + return false; + } + + static private boolean jj_3R_Statement_287_9_50() + { + if (jj_3R_ExpressionStatement_303_9_85()) return true; + return false; + } + + static private boolean jj_3R_Statement_286_9_24() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_14()) { + jj_scanpos = xsp; + if (jj_3R_Statement_287_9_50()) { + jj_scanpos = xsp; + if (jj_3R_Statement_288_9_51()) { + jj_scanpos = xsp; + if (jj_3R_Statement_289_9_52()) { + jj_scanpos = xsp; + if (jj_3R_Statement_290_9_53()) { + jj_scanpos = xsp; + if (jj_3R_Statement_291_9_54()) return true; + } + } + } + } + } + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_279_14_145() + { + if (jj_3R_ParameterTypeList_234_9_16()) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_281_11_146() + { + if (jj_scan_token(62)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_281_17_151()) jj_scanpos = xsp; + if (jj_scan_token(63)) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_278_14_144() + { + if (jj_3R_ConstantExpression_362_9_84()) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_281_11_139() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_281_11_146()) { + jj_scanpos = xsp; + if (jj_3R_DirectAbstractDeclarator_281_46_147()) return true; + } + return false; + } + + static private boolean jj_3_10() + { + if (jj_3R_Declarator_211_9_18()) return true; + return false; + } + + static private boolean jj_3_13() + { + if (jj_scan_token(60)) return true; + if (jj_3R_AbstractDeclarator_271_9_21()) return true; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_279_9_112() + { + if (jj_scan_token(60)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_279_14_145()) jj_scanpos = xsp; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_278_9_111() + { + if (jj_scan_token(62)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_278_14_144()) jj_scanpos = xsp; + if (jj_scan_token(63)) return true; + return false; + } + + static private boolean jj_3R_DirectAbstractDeclarator_277_9_82() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_13()) { + jj_scanpos = xsp; + if (jj_3R_DirectAbstractDeclarator_278_9_111()) { + jj_scanpos = xsp; + if (jj_3R_DirectAbstractDeclarator_279_9_112()) return true; + } + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_DirectAbstractDeclarator_281_11_139()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3_11() + { + if (jj_scan_token(58)) return true; + if (jj_3R_Initializer_254_9_19()) return true; + return false; + } + + static private boolean jj_3_12() + { + if (jj_3R_Pointer_224_9_20()) return true; + return false; + } + + static private boolean jj_3R_AbstractDeclarator_272_10_81() + { + if (jj_3R_Pointer_224_9_20()) return true; + return false; + } + + static private boolean jj_3R_AbstractDeclarator_272_9_45() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_AbstractDeclarator_272_10_81()) jj_scanpos = xsp; + if (jj_3R_DirectAbstractDeclarator_277_9_82()) return true; + return false; + } + + static private boolean jj_3R_AbstractDeclarator_271_9_21() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_12()) { + jj_scanpos = xsp; + if (jj_3R_AbstractDeclarator_272_9_45()) return true; + } + return false; + } + + static private boolean jj_3R_ParameterDeclaration_244_35_106() + { + if (jj_3R_Declarator_211_9_18()) return true; + return false; + } + + static private boolean jj_3R_TypeName_265_9_28() + { + if (jj_3R_SpecifierQualifierList_203_9_15()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_TypeName_265_36_61()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_IdentifierList_249_23_141() + { + if (jj_scan_token(58)) return true; + if (jj_3R_Identifier_462_9_83()) return true; + return false; + } + + static private boolean jj_3_9() + { + if (jj_scan_token(58)) return true; + if (jj_3R_ParameterDeclaration_244_9_17()) return true; + return false; + } + + static private boolean jj_3R_InitializerList_260_9_148() + { + if (jj_3R_Initializer_254_9_19()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_11()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_Initializer_254_11_41() + { + if (jj_3R_AssignmentExpression_346_9_66()) return true; + return false; + } + + static private boolean jj_3R_Initializer_255_9_42() + { + if (jj_scan_token(66)) return true; + if (jj_3R_InitializerList_260_9_148()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(58)) jj_scanpos = xsp; + if (jj_scan_token(67)) return true; + return false; + } + + static private boolean jj_3R_Pointer_224_39_44() + { + if (jj_3R_Pointer_224_9_20()) return true; + return false; + } + + static private boolean jj_3R_Initializer_254_9_19() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_Initializer_254_11_41()) { + jj_scanpos = xsp; + if (jj_3R_Initializer_255_9_42()) return true; + } + return false; + } + + static private boolean jj_3R_ParameterTypeList_234_26_135() + { + if (jj_scan_token(58)) return true; + if (jj_scan_token(65)) return true; + return false; + } + + static private boolean jj_3R_IdentifierList_249_9_136() + { + if (jj_3R_Identifier_462_9_83()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_IdentifierList_249_23_141()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_ParameterDeclaration_244_9_17() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ParameterDeclaration_244_35_106()) { + jj_scanpos = xsp; + if (jj_3R_ParameterDeclaration_244_74_107()) return true; + } + return false; + } + + static private boolean jj_3R_ParameterList_239_9_38() + { + if (jj_3R_ParameterDeclaration_244_9_17()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_9()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_ParameterTypeList_234_9_16() + { + if (jj_3R_ParameterList_239_9_38()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ParameterTypeList_234_26_135()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3_7() + { + if (jj_3R_SpecifierQualifierList_203_9_15()) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_216_26_78() + { + if (jj_scan_token(60)) return true; + if (jj_3R_Declarator_211_9_18()) return true; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3_6() + { + if (jj_3R_SpecifierQualifierList_203_9_15()) return true; + return false; + } + + static private boolean jj_3R_Pointer_224_15_43() + { + if (jj_3R_TypeQualifierList_229_9_80()) return true; + return false; + } + + static private boolean jj_3R_TypeQualifierList_229_10_110() + { + if (jj_3R_TypeQualifier_185_9_72()) return true; + return false; + } + + static private boolean jj_3R_TypeQualifierList_229_9_80() + { + Token xsp; + if (jj_3R_TypeQualifierList_229_10_110()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_TypeQualifierList_229_10_110()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_DirectDeclarator_217_17_131() + { + if (jj_3R_ConstantExpression_362_9_84()) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_219_15_132() + { + if (jj_3R_IdentifierList_249_9_136()) return true; + return false; + } + + static private boolean jj_3R_Pointer_224_9_20() + { + if (jj_scan_token(64)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_Pointer_224_15_43()) jj_scanpos = xsp; + xsp = jj_scanpos; + if (jj_3R_Pointer_224_39_44()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_SpecifierQualifierList_205_27_76() + { + if (jj_3R_SpecifierQualifierList_203_9_15()) return true; + return false; + } + + static private boolean jj_3R_SpecifierQualifierList_203_27_75() + { + if (jj_3R_SpecifierQualifierList_203_9_15()) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_217_11_79() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectDeclarator_217_11_108()) { + jj_scanpos = xsp; + if (jj_3_8()) { + jj_scanpos = xsp; + if (jj_3R_DirectDeclarator_219_9_109()) return true; + } + } + return false; + } + + static private boolean jj_3R_DirectDeclarator_217_11_108() + { + if (jj_scan_token(62)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectDeclarator_217_17_131()) jj_scanpos = xsp; + if (jj_scan_token(63)) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_219_9_109() + { + if (jj_scan_token(60)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectDeclarator_219_15_132()) jj_scanpos = xsp; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3_8() + { + if (jj_scan_token(60)) return true; + if (jj_3R_ParameterTypeList_234_9_16()) return true; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_216_11_77() + { + if (jj_3R_Identifier_462_9_83()) return true; + return false; + } + + static private boolean jj_3R_DirectDeclarator_216_9_40() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DirectDeclarator_216_11_77()) { + jj_scanpos = xsp; + if (jj_3R_DirectDeclarator_216_26_78()) return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_DirectDeclarator_217_11_79()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_Declarator_211_11_39() + { + if (jj_3R_Pointer_224_9_20()) return true; + return false; + } + + static private boolean jj_3R_InitDeclarator_198_24_129() + { + if (jj_scan_token(59)) return true; + if (jj_3R_Initializer_254_9_19()) return true; + return false; + } + + static private boolean jj_3R_Declarator_211_9_18() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_Declarator_211_11_39()) jj_scanpos = xsp; + if (jj_3R_DirectDeclarator_216_9_40()) return true; + return false; + } + + static private boolean jj_3R_InitDeclaratorList_193_27_105() + { + if (jj_scan_token(58)) return true; + if (jj_3R_InitDeclarator_198_9_104()) return true; + return false; + } + + static private boolean jj_3R_SpecifierQualifierList_205_9_37() + { + if (jj_3R_TypeQualifier_185_9_72()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_SpecifierQualifierList_205_27_76()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_SpecifierQualifierList_203_9_36() + { + if (jj_3R_TypeSpecifier_173_9_70()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_SpecifierQualifierList_203_27_75()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_SpecifierQualifierList_203_9_15() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_SpecifierQualifierList_203_9_36()) { + jj_scanpos = xsp; + if (jj_3R_SpecifierQualifierList_205_9_37()) return true; + } + return false; + } + + static private boolean jj_3R_InitDeclarator_198_9_104() + { + if (jj_3R_Declarator_211_9_18()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_InitDeclarator_198_24_129()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_InitDeclaratorList_193_9_74() + { + if (jj_3R_InitDeclarator_198_9_104()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_InitDeclaratorList_193_27_105()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3_3() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_TypeQualifier_185_9_72() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(38)) { + jj_scanpos = xsp; + if (jj_scan_token(22)) return true; + } + return false; + } + + static private boolean jj_3_5() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3_4() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_149_35_69() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_TypeSpecifier_173_9_70() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(46)) { + jj_scanpos = xsp; + if (jj_scan_token(47)) { + jj_scanpos = xsp; + if (jj_scan_token(40)) { + jj_scanpos = xsp; + if (jj_scan_token(50)) { + jj_scanpos = xsp; + if (jj_scan_token(43)) { + jj_scanpos = xsp; + if (jj_scan_token(39)) { + jj_scanpos = xsp; + if (jj_scan_token(27)) { + jj_scanpos = xsp; + if (jj_scan_token(34)) { + jj_scanpos = xsp; + if (jj_scan_token(24)) { + jj_scanpos = xsp; + if (jj_scan_token(53)) { + jj_scanpos = xsp; + if (jj_scan_token(20)) return true; + } + } + } + } + } + } + } + } + } + } + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_153_27_73() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_151_28_71() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_Declaration_139_35_35() + { + if (jj_3R_InitDeclaratorList_193_9_74()) return true; + return false; + } + + static private boolean jj_3R_StorageClassSpecifier_162_9_68() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(45)) { + jj_scanpos = xsp; + if (jj_scan_token(23)) { + jj_scanpos = xsp; + if (jj_scan_token(33)) { + jj_scanpos = xsp; + if (jj_scan_token(31)) { + jj_scanpos = xsp; + if (jj_scan_token(25)) return true; + } + } + } + } + return false; + } + + static private boolean jj_3_2() + { + if (jj_3R_Declaration_139_9_14()) return true; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_153_9_34() + { + if (jj_3R_TypeQualifier_185_9_72()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DeclarationSpecifiers_153_27_73()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_151_9_33() + { + if (jj_3R_TypeSpecifier_173_9_70()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DeclarationSpecifiers_151_28_71()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_149_9_32() + { + if (jj_3R_StorageClassSpecifier_162_9_68()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DeclarationSpecifiers_149_35_69()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_DeclarationSpecifiers_149_9_13() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_DeclarationSpecifiers_149_9_32()) { + jj_scanpos = xsp; + if (jj_3R_DeclarationSpecifiers_151_9_33()) { + jj_scanpos = xsp; + if (jj_3R_DeclarationSpecifiers_153_9_34()) return true; + } + } + return false; + } + + static private boolean jj_3R_DeclarationList_144_11_49() + { + if (jj_3R_Declaration_139_9_14()) return true; + return false; + } + + static private boolean jj_3R_DeclarationList_144_9_23() + { + Token xsp; + if (jj_3R_DeclarationList_144_11_49()) return true; + while (true) { + xsp = jj_scanpos; + if (jj_3R_DeclarationList_144_11_49()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3_1() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + return false; + } + + static private boolean jj_3R_Declaration_139_9_14() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_Declaration_139_35_35()) jj_scanpos = xsp; + if (jj_scan_token(57)) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_427_70_92() + { + if (jj_scan_token(60)) return true; + if (jj_3R_TypeName_265_9_28()) return true; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_ArgumentExpressionList_454_34_67() + { + if (jj_scan_token(58)) return true; + if (jj_3R_AssignmentExpression_346_9_66()) return true; + return false; + } + + static private boolean jj_3R_Constant_473_9_127() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(12)) { + jj_scanpos = xsp; + if (jj_scan_token(16)) { + jj_scanpos = xsp; + if (jj_scan_token(18)) { + jj_scanpos = xsp; + if (jj_scan_token(19)) return true; + } + } + } + return false; + } + + static private boolean jj_3R_Identifier_462_9_83() + { + if (jj_scan_token(IDENTIFIER)) return true; + return false; + } + + static private boolean jj_3R_PostfixExpression_437_31_65() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_PostfixExpression_437_31_99()) { + jj_scanpos = xsp; + if (jj_3R_PostfixExpression_438_9_100()) { + jj_scanpos = xsp; + if (jj_3R_PostfixExpression_439_9_101()) { + jj_scanpos = xsp; + if (jj_3R_PostfixExpression_440_9_102()) { + jj_scanpos = xsp; + if (jj_scan_token(97)) { + jj_scanpos = xsp; + if (jj_scan_token(98)) return true; + } + } + } + } + } + return false; + } + + static private boolean jj_3R_PostfixExpression_437_31_99() + { + if (jj_scan_token(62)) return true; + if (jj_3R_Expression_341_9_95()) return true; + if (jj_scan_token(63)) return true; + return false; + } + + static private boolean jj_3R_ArgumentExpressionList_454_9_31() + { + if (jj_3R_AssignmentExpression_346_9_66()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_ArgumentExpressionList_454_34_67()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3_22() + { + if (jj_3R_ArgumentExpressionList_454_9_31()) return true; + return false; + } + + static private boolean jj_3R_PrimaryExpression_447_11_96() + { + if (jj_3R_Identifier_462_9_83()) return true; + return false; + } + + static private boolean jj_3R_PrimaryExpression_449_9_98() + { + if (jj_scan_token(60)) return true; + if (jj_3R_Expression_341_9_95()) return true; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3_20() + { + if (jj_3R_UnaryExpression_423_9_25()) return true; + return false; + } + + static private boolean jj_3R_PrimaryExpression_448_9_97() + { + if (jj_3R_Constant_473_9_127()) return true; + return false; + } + + static private boolean jj_3R_PrimaryExpression_447_9_64() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_PrimaryExpression_447_11_96()) { + jj_scanpos = xsp; + if (jj_3R_PrimaryExpression_448_9_97()) { + jj_scanpos = xsp; + if (jj_3R_PrimaryExpression_449_9_98()) return true; + } + } + return false; + } + + static private boolean jj_3R_PostfixExpression_438_15_128() + { + if (jj_3R_ArgumentExpressionList_454_9_31()) return true; + return false; + } + + static private boolean jj_3R_PostfixExpression_440_9_102() + { + if (jj_scan_token(102)) return true; + if (jj_3R_Identifier_462_9_83()) return true; + return false; + } + + static private boolean jj_3R_PostfixExpression_439_9_101() + { + if (jj_scan_token(101)) return true; + if (jj_3R_Identifier_462_9_83()) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_427_20_91() + { + if (jj_3R_UnaryExpression_423_9_25()) return true; + return false; + } + + static private boolean jj_3R_PostfixExpression_438_9_100() + { + if (jj_scan_token(60)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_PostfixExpression_438_15_128()) jj_scanpos = xsp; + if (jj_scan_token(61)) return true; + return false; + } + + static private boolean jj_3R_PostfixExpression_437_9_30() + { + if (jj_3R_PrimaryExpression_447_9_64()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_PostfixExpression_437_31_65()) { jj_scanpos = xsp; break; } + } + return false; + } + + static private boolean jj_3R_AdditiveExpression_407_38_158() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(93)) { + jj_scanpos = xsp; + if (jj_scan_token(94)) return true; + } + if (jj_3R_AdditiveExpression_407_9_155()) return true; + return false; + } + + static private boolean jj_3R_UnaryOperator_432_9_90() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(84)) { + jj_scanpos = xsp; + if (jj_scan_token(64)) { + jj_scanpos = xsp; + if (jj_scan_token(93)) { + jj_scanpos = xsp; + if (jj_scan_token(94)) { + jj_scanpos = xsp; + if (jj_scan_token(99)) { + jj_scanpos = xsp; + if (jj_scan_token(100)) return true; + } + } + } + } + } + return false; + } + + static private boolean jj_3R_MultiplicativeExpression_412_28_159() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(64)) { + jj_scanpos = xsp; + if (jj_scan_token(95)) { + jj_scanpos = xsp; + if (jj_scan_token(96)) return true; + } + } + if (jj_3R_MultiplicativeExpression_412_9_157()) return true; + return false; + } + + static private boolean jj_3_19() + { + if (jj_scan_token(60)) return true; + if (jj_3R_TypeName_265_9_28()) return true; + if (jj_scan_token(61)) return true; + if (jj_3R_CastExpression_417_9_29()) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_427_9_58() + { + if (jj_scan_token(SIZEOF)) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_UnaryExpression_427_20_91()) { + jj_scanpos = xsp; + if (jj_3R_UnaryExpression_427_70_92()) return true; + } + return false; + } + + static private boolean jj_3R_UnaryExpression_426_9_57() + { + if (jj_3R_UnaryOperator_432_9_90()) return true; + if (jj_3R_CastExpression_417_9_29()) return true; + return false; + } + + static private boolean jj_3R_ShiftExpression_402_32_156() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(91)) { + jj_scanpos = xsp; + if (jj_scan_token(92)) return true; + } + if (jj_3R_ShiftExpression_402_9_153()) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_425_9_56() + { + if (jj_scan_token(98)) return true; + if (jj_3R_UnaryExpression_423_9_25()) return true; + return false; + } + + static private boolean jj_3_21() + { + if (jj_3R_PostfixExpression_437_9_30()) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_424_9_55() + { + if (jj_scan_token(97)) return true; + if (jj_3R_UnaryExpression_423_9_25()) return true; + return false; + } + + static private boolean jj_3R_UnaryExpression_423_9_25() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3_21()) { + jj_scanpos = xsp; + if (jj_3R_UnaryExpression_424_9_55()) { + jj_scanpos = xsp; + if (jj_3R_UnaryExpression_425_9_56()) { + jj_scanpos = xsp; + if (jj_3R_UnaryExpression_426_9_57()) { + jj_scanpos = xsp; + if (jj_3R_UnaryExpression_427_9_58()) return true; + } + } + } + } + return false; + } + + static private boolean jj_3R_CastExpression_417_11_62() + { + if (jj_scan_token(60)) return true; + if (jj_3R_TypeName_265_9_28()) return true; + if (jj_scan_token(61)) return true; + if (jj_3R_CastExpression_417_9_29()) return true; + return false; + } + + static private boolean jj_3R_CastExpression_418_9_63() + { + if (jj_3R_UnaryExpression_423_9_25()) return true; + return false; + } + + static private boolean jj_3R_RelationalExpression_397_29_154() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(87)) { + jj_scanpos = xsp; + if (jj_scan_token(88)) { + jj_scanpos = xsp; + if (jj_scan_token(89)) { + jj_scanpos = xsp; + if (jj_scan_token(90)) return true; + } + } + } + if (jj_3R_RelationalExpression_397_9_149()) return true; + return false; + } + + static private boolean jj_3R_EqualityExpression_392_34_150() + { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(85)) { + jj_scanpos = xsp; + if (jj_scan_token(86)) return true; + } + if (jj_3R_EqualityExpression_392_9_142()) return true; + return false; + } + + static private boolean jj_3R_CastExpression_417_9_29() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_CastExpression_417_11_62()) { + jj_scanpos = xsp; + if (jj_3R_CastExpression_418_9_63()) return true; + } + return false; + } + + static private boolean jj_3R_MultiplicativeExpression_412_9_157() + { + if (jj_3R_CastExpression_417_9_29()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_MultiplicativeExpression_412_28_159()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_ANDExpression_387_32_143() + { + if (jj_scan_token(84)) return true; + if (jj_3R_ANDExpression_387_9_137()) return true; + return false; + } + + static private boolean jj_3R_AdditiveExpression_407_9_155() + { + if (jj_3R_MultiplicativeExpression_412_9_157()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_AdditiveExpression_407_38_158()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_InclusiveORExpression_377_35_134() + { + if (jj_scan_token(82)) return true; + if (jj_3R_InclusiveORExpression_377_9_123()) return true; + return false; + } + + static private boolean jj_3R_ShiftExpression_402_9_153() + { + if (jj_3R_AdditiveExpression_407_9_155()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ShiftExpression_402_32_156()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_ExclusiveORExpression_382_27_138() + { + if (jj_scan_token(83)) return true; + if (jj_3R_ExclusiveORExpression_382_9_133()) return true; + return false; + } + + static private boolean jj_3R_LogicalANDExpression_372_35_124() + { + if (jj_scan_token(81)) return true; + if (jj_3R_LogicalANDExpression_372_9_93()) return true; + return false; + } + + static private boolean jj_3R_Expression_341_66_126() + { + if (jj_3R_DeclarationSpecifiers_149_9_13()) return true; + if (jj_3R_InitDeclaratorList_193_9_74()) return true; + return false; + } + + static private boolean jj_3R_RelationalExpression_397_9_149() + { + if (jj_3R_ShiftExpression_402_9_153()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_RelationalExpression_397_29_154()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_EqualityExpression_392_9_142() + { + if (jj_3R_RelationalExpression_397_9_149()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_EqualityExpression_392_34_150()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_LogicalORExpression_367_34_94() + { + if (jj_scan_token(80)) return true; + if (jj_3R_LogicalORExpression_367_9_59()) return true; + return false; + } + + static private boolean jj_3R_ANDExpression_387_9_137() + { + if (jj_3R_EqualityExpression_392_9_142()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ANDExpression_387_32_143()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_ExclusiveORExpression_382_9_133() + { + if (jj_3R_ANDExpression_387_9_137()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_ExclusiveORExpression_382_27_138()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_3R_ConditionalExpression_357_33_60() + { + if (jj_scan_token(79)) return true; + if (jj_3R_Expression_341_9_95()) return true; + if (jj_scan_token(68)) return true; + if (jj_3R_ConditionalExpression_357_9_27()) return true; + return false; + } + + static private boolean jj_3R_InclusiveORExpression_377_9_123() + { + if (jj_3R_ExclusiveORExpression_382_9_133()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_InclusiveORExpression_377_35_134()) jj_scanpos = xsp; + return false; + } + + static private boolean jj_initialized_once = false; + /** Generated Token Manager. */ + static public CParserTokenManager token_source; + static SimpleCharStream jj_input_stream; + /** Current token. */ + static public Token token; + /** Next token. */ + static public Token jj_nt; + static private int jj_ntk; + static private Token jj_scanpos, jj_lastpos; + static private int jj_la; + static private int jj_gen; + static final private int[] jj_la1 = new int[73]; + static private int[] jj_la1_0; + static private int[] jj_la1_1; + static private int[] jj_la1_2; + static private int[] jj_la1_3; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0x0,0x8bd00000,0x82800000,0x9100000,0x400000,0x0,0x0,0x9500000,0x0,0x0,0x0,0x100d1000,0x0,0x0,0x0,0x400000,0x0,0x400000,0x0,0x0,0x0,0x0,0x100d1000,0x0,0x0,0x0,0x100d1000,0x8bd00000,0x0,0x0,0x100d1000,0x8bd00000,0x0,0xfbfd1000,0x4000000,0x9bdd1000,0xfffd1000,0xfffd1000,0x20000000,0x9bdd1000,0x9bdd1000,0x9bdd1000,0x0,0x9bdd1000,0x40200000,0x0,0x9bdd1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100d1000,0x0,0x10000000,0x0,0x0,0x0,0xd1000,0x0,0xd1000,}; + } + private static void jj_la1_init_1() { + jj_la1_1 = new int[] {0x10400000,0x24e9c6,0x2002,0x24c984,0x40,0x4000000,0x8000000,0x24c9c4,0x0,0x10400000,0x50000000,0x10400000,0x400000,0x40000000,0x10000000,0x40,0x0,0x40,0x4000000,0x50000000,0x4000000,0x4000000,0x10400000,0x50000000,0x0,0x50000000,0x10400000,0x24e9c6,0x50000000,0x50000000,0x10400000,0x24e9c6,0x50000000,0x127fe9de,0x400400,0x1064e9c6,0x127fedde,0x127fedde,0x80000,0x1064e9c6,0x1064e9c6,0x1064e9c6,0x120008,0x1064e9c6,0x10010,0x4000000,0x1064e9c6,0x8000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10400000,0x10000000,0x0,0x0,0x50000000,0x50000000,0x10400000,0x4000000,0x0,}; + } + private static void jj_la1_init_2() { + jj_la1_2 = new int[] {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x60100001,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x0,0x60100005,0x1,0x1,0x1,0x60100001,0x0,0x0,0x0,0x60100001,0x0,0x0,0x60100005,0x0,0x60100001,0x60100005,0x60100005,0x0,0x60100001,0x60100001,0x60100001,0x0,0x60100001,0x0,0x0,0x60100001,0x7fe0,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x600000,0x600000,0x7800000,0x7800000,0x18000000,0x18000000,0x60000000,0x60000000,0x80000001,0x80000001,0x60100001,0x0,0x60100001,0x60100001,0x0,0x0,0x0,0x0,0x0,}; + } + private static void jj_la1_init_3() { + jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x1e,0x0,0x0,0x1e,0x0,0x1e,0x1e,0x1e,0x0,0x1e,0x1e,0x1e,0x0,0x1e,0x0,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1e,0x0,0x1e,0x18,0x66,0x66,0x0,0x0,0x0,}; + } + static final private JJCalls[] jj_2_rtns = new JJCalls[22]; + static private boolean jj_rescan = false; + static private int jj_gc = 0; + + /** Constructor with InputStream. */ + public CParser(java.io.InputStream stream) { + this(stream, null); + } + /** Constructor with InputStream and supplied encoding */ + public CParser(java.io.InputStream stream, String encoding) { + if (jj_initialized_once) { + System.out.println("ERROR: Second call to constructor of static parser. "); + System.out.println(" You must either use ReInit() or set the JavaCC option STATIC to false"); + System.out.println(" during parser generation."); + throw new Error(); + } + jj_initialized_once = true; + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source = new CParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + static public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + /** Reinitialise. */ + static public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jjtree.reset(); + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public CParser(java.io.Reader stream) { + if (jj_initialized_once) { + System.out.println("ERROR: Second call to constructor of static parser. "); + System.out.println(" You must either use ReInit() or set the JavaCC option STATIC to false"); + System.out.println(" during parser generation."); + throw new Error(); + } + jj_initialized_once = true; + jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new CParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + static public void ReInit(java.io.Reader stream) { + if (jj_input_stream == null) { + jj_input_stream = new SimpleCharStream(stream, 1, 1); + } else { + jj_input_stream.ReInit(stream, 1, 1); + } + if (token_source == null) { + token_source = new CParserTokenManager(jj_input_stream); + } + + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jjtree.reset(); + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public CParser(CParserTokenManager tm) { + if (jj_initialized_once) { + System.out.println("ERROR: Second call to constructor of static parser. "); + System.out.println(" You must either use ReInit() or set the JavaCC option STATIC to false"); + System.out.println(" during parser generation."); + throw new Error(); + } + jj_initialized_once = true; + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(CParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jjtree.reset(); + jj_gen = 0; + for (int i = 0; i < 73; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + static private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + @SuppressWarnings("serial") + static private final class LookaheadSuccess extends java.lang.Error { + @Override + public Throwable fillInStackTrace() { + return this; + } + } + static private final LookaheadSuccess jj_ls = new LookaheadSuccess(); + static private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + +/** Get the next Token. */ + static final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + +/** Get the specific Token. */ + static final public Token getToken(int index) { + Token t = token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + static private int jj_ntk_f() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + static private java.util.List jj_expentries = new java.util.ArrayList(); + static private int[] jj_expentry; + static private int jj_kind = -1; + static private int[] jj_lasttokens = new int[100]; + static private int jj_endpos; + + static private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) { + return; + } + + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + + for (int[] oldentry : jj_expentries) { + if (oldentry.length == jj_expentry.length) { + boolean isMatched = true; + + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + isMatched = false; + break; + } + + } + if (isMatched) { + jj_expentries.add(jj_expentry); + break; + } + } + } + + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + static public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[103]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 73; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1< jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + case 8: jj_3_9(); break; + case 9: jj_3_10(); break; + case 10: jj_3_11(); break; + case 11: jj_3_12(); break; + case 12: jj_3_13(); break; + case 13: jj_3_14(); break; + case 14: jj_3_15(); break; + case 15: jj_3_16(); break; + case 16: jj_3_17(); break; + case 17: jj_3_18(); break; + case 18: jj_3_19(); break; + case 19: jj_3_20(); break; + case 20: jj_3_21(); break; + case 21: jj_3_22(); break; + } + } + p = p.next; + } while (p != null); + + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + static private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + + p.gen = jj_gen + xla - jj_la; + p.first = token; + p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } + +} diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParserConstants.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserConstants.java new file mode 100644 index 0000000..658fa66 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserConstants.java @@ -0,0 +1,216 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree&JavaCC: Do not edit this line. CParserConstants.java */ + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface CParserConstants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int INTEGER_LITERAL = 12; + /** RegularExpression Id. */ + int DECIMAL_LITERAL = 13; + /** RegularExpression Id. */ + int HEX_LITERAL = 14; + /** RegularExpression Id. */ + int OCTAL_LITERAL = 15; + /** RegularExpression Id. */ + int FLOATING_POINT_LITERAL = 16; + /** RegularExpression Id. */ + int EXPONENT = 17; + /** RegularExpression Id. */ + int CHARACTER_LITERAL = 18; + /** RegularExpression Id. */ + int STRING_LITERAL = 19; + /** RegularExpression Id. */ + int UNDEFINED_TYPE = 20; + /** RegularExpression Id. */ + int CONTINUE = 21; + /** RegularExpression Id. */ + int VOLATILE = 22; + /** RegularExpression Id. */ + int REGISTER = 23; + /** RegularExpression Id. */ + int UNSIGNED = 24; + /** RegularExpression Id. */ + int TYPEDEF = 25; + /** RegularExpression Id. */ + int DFLT = 26; + /** RegularExpression Id. */ + int DOUBLE = 27; + /** RegularExpression Id. */ + int SIZEOF = 28; + /** RegularExpression Id. */ + int SWITCH = 29; + /** RegularExpression Id. */ + int RETURN = 30; + /** RegularExpression Id. */ + int EXTERN = 31; + /** RegularExpression Id. */ + int STRUCT = 32; + /** RegularExpression Id. */ + int STATIC = 33; + /** RegularExpression Id. */ + int SIGNED = 34; + /** RegularExpression Id. */ + int WHILE = 35; + /** RegularExpression Id. */ + int BREAK = 36; + /** RegularExpression Id. */ + int UNION = 37; + /** RegularExpression Id. */ + int CONST = 38; + /** RegularExpression Id. */ + int FLOAT = 39; + /** RegularExpression Id. */ + int SHORT = 40; + /** RegularExpression Id. */ + int ELSE = 41; + /** RegularExpression Id. */ + int CASE = 42; + /** RegularExpression Id. */ + int LONG = 43; + /** RegularExpression Id. */ + int ENUM = 44; + /** RegularExpression Id. */ + int AUTO = 45; + /** RegularExpression Id. */ + int VOID = 46; + /** RegularExpression Id. */ + int CHAR = 47; + /** RegularExpression Id. */ + int GOTO = 48; + /** RegularExpression Id. */ + int FOR = 49; + /** RegularExpression Id. */ + int INT = 50; + /** RegularExpression Id. */ + int IF = 51; + /** RegularExpression Id. */ + int DO = 52; + /** RegularExpression Id. */ + int CODE = 53; + /** RegularExpression Id. */ + int IDENTIFIER = 54; + /** RegularExpression Id. */ + int LETTER = 55; + /** RegularExpression Id. */ + int DIGIT = 56; + + /** Lexical state. */ + int DEFAULT = 0; + /** Lexical state. */ + int PREPROCESSOR_OUTPUT = 1; + + /** Literal token values. */ + String[] tokenImage = { + "", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "", + "", + "\"#\"", + "\"\\n\"", + "\"\\\\\\n\"", + "\"\\\\\\r\\n\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"continue\"", + "\"volatile\"", + "\"register\"", + "\"unsigned\"", + "\"typedef\"", + "\"default\"", + "\"double\"", + "\"sizeof\"", + "\"switch\"", + "\"return\"", + "\"extern\"", + "\"struct\"", + "\"static\"", + "\"signed\"", + "\"while\"", + "\"break\"", + "\"union\"", + "\"const\"", + "\"float\"", + "\"short\"", + "\"else\"", + "\"case\"", + "\"long\"", + "\"enum\"", + "\"auto\"", + "\"void\"", + "\"char\"", + "\"goto\"", + "\"for\"", + "\"int\"", + "\"if\"", + "\"do\"", + "\"code\"", + "", + "", + "", + "\";\"", + "\",\"", + "\"=\"", + "\"(\"", + "\")\"", + "\"[\"", + "\"]\"", + "\"*\"", + "\"...\"", + "\"{\"", + "\"}\"", + "\":\"", + "\"*=\"", + "\"/=\"", + "\"%=\"", + "\"+=\"", + "\"-=\"", + "\"<<=\"", + "\">>=\"", + "\"&=\"", + "\"^=\"", + "\"|=\"", + "\"?\"", + "\"||\"", + "\"&&\"", + "\"|\"", + "\"^\"", + "\"&\"", + "\"==\"", + "\"!=\"", + "\"<\"", + "\">\"", + "\"<=\"", + "\">=\"", + "\"<<\"", + "\">>\"", + "\"+\"", + "\"-\"", + "\"/\"", + "\"%\"", + "\"++\"", + "\"--\"", + "\"~\"", + "\"!\"", + "\".\"", + "\"->\"", + }; + +} diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParserDefaultVisitor.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserDefaultVisitor.java new file mode 100644 index 0000000..484a83a --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserDefaultVisitor.java @@ -0,0 +1,169 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. CParserDefaultVisitor.java Version 7.0.9 */ +public class CParserDefaultVisitor implements CParserVisitor{ + public Object defaultVisit(SimpleNode node, Object data){ + node.childrenAccept(this, data); + return data; + } + public Object visit(SimpleNode node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTFunctionDefinition node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDeclaration node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDeclarationList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDeclarationSpecifiers node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTGhostStringToken node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTTypeStringToken node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTStringToken node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTInitDeclaratorList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTInitDeclarator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTSpecifierQualifierList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDeclarator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDirectDeclarator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTPointer node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTTypeQualifierList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTParameterTypeList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTParameterList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTParameterDeclaration node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTIdentifierList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTInitializer node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTInitializerList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTTypeName node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTAbstractDeclarator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTDirectAbstractDeclarator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTLabeledStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTExpressionStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTCompoundStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTStatementList node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTSelectionStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTIterationStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTJumpStatement node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTAssignmentExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTAssignmentOperator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTConditionalExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTConstantExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTLogicalORExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTLogicalANDExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTInclusiveORExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTExclusiveORExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTANDExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTEqualityExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTRelationalExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTShiftExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTAdditiveExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTMultiplicativeExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTCastExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTUnaryExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTUnaryOperator node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTPostfixExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTPrimaryExpression node, Object data){ + return defaultVisit(node, data); + } + public Object visit(ASTArgumentExpressionList node, Object data){ + return defaultVisit(node, data); + } +} +/* JavaCC - OriginalChecksum=3e084c4d4fc2f72217d78b4001ae5330 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTokenManager.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTokenManager.java new file mode 100644 index 0000000..b22efc5 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTokenManager.java @@ -0,0 +1,1483 @@ +package ghidrust.decompiler.parser.c.gen; + +/* CParserTokenManager.java */ +/* Generated By:JJTree&JavaCC: Do not edit this line. CParserTokenManager.java */ +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import ghidrust.decompiler.parser.c.CVisitor; + +/** Token Manager. */ +@SuppressWarnings ("unused") +public class CParserTokenManager implements CParserConstants { + + /** Debug output. */ + public static java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public static void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private static final int jjStopStringLiteralDfa_0(int pos, long active0, long active1){ + switch (pos) + { + case 0: + if ((active1 & 0x2000000002L) != 0L) + return 4; + if ((active0 & 0x2001000000L) != 0L) + { + jjmatchedKind = 54; + return 38; + } + if ((active1 & 0x80000040L) != 0L) + return 62; + if ((active0 & 0x3fffdffee00000L) != 0L) + { + jjmatchedKind = 54; + return 41; + } + return -1; + case 1: + if ((active0 & 0x2001000000L) != 0L) + { + if (jjmatchedPos != 1) + { + jjmatchedKind = 54; + jjmatchedPos = 1; + } + return 37; + } + if ((active0 & 0x27ffdff6e00000L) != 0L) + { + if (jjmatchedPos != 1) + { + jjmatchedKind = 54; + jjmatchedPos = 1; + } + return 41; + } + if ((active0 & 0x18000008000000L) != 0L) + return 41; + return -1; + case 2: + if ((active0 & 0x6000000000000L) != 0L) + return 41; + if ((active0 & 0x21ffffffe00000L) != 0L) + { + jjmatchedKind = 54; + jjmatchedPos = 2; + return 41; + } + return -1; + case 3: + if ((active0 & 0x21fe0000000000L) != 0L) + return 41; + if ((active0 & 0x1ffffe00000L) != 0L) + { + jjmatchedKind = 54; + jjmatchedPos = 3; + return 41; + } + return -1; + case 4: + if ((active0 & 0x7ffe00000L) != 0L) + { + jjmatchedKind = 54; + jjmatchedPos = 4; + return 41; + } + if ((active0 & 0x1f800000000L) != 0L) + return 41; + return -1; + case 5: + if ((active0 & 0x7f8000000L) != 0L) + return 41; + if ((active0 & 0x7e00000L) != 0L) + { + jjmatchedKind = 54; + jjmatchedPos = 5; + return 41; + } + return -1; + case 6: + if ((active0 & 0x6000000L) != 0L) + return 41; + if ((active0 & 0x1e00000L) != 0L) + { + jjmatchedKind = 54; + jjmatchedPos = 6; + return 41; + } + return -1; + default : + return -1; + } +} +private static final int jjStartNfa_0(int pos, long active0, long active1){ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1); +} +static private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +static private int jjMoveStringLiteralDfa0_0(){ + switch(curChar) + { + case 33: + jjmatchedKind = 100; + return jjMoveStringLiteralDfa1_0(0x0L, 0x400000L); + case 35: + return jjStopAtPos(0, 7); + case 37: + jjmatchedKind = 96; + return jjMoveStringLiteralDfa1_0(0x0L, 0x80L); + case 38: + jjmatchedKind = 84; + return jjMoveStringLiteralDfa1_0(0x0L, 0x21000L); + case 40: + return jjStopAtPos(0, 60); + case 41: + return jjStopAtPos(0, 61); + case 42: + jjmatchedKind = 64; + return jjMoveStringLiteralDfa1_0(0x0L, 0x20L); + case 43: + jjmatchedKind = 93; + return jjMoveStringLiteralDfa1_0(0x0L, 0x200000100L); + case 44: + return jjStopAtPos(0, 58); + case 45: + jjmatchedKind = 94; + return jjMoveStringLiteralDfa1_0(0x0L, 0x4400000200L); + case 46: + jjmatchedKind = 101; + return jjMoveStringLiteralDfa1_0(0x0L, 0x2L); + case 47: + jjmatchedKind = 95; + return jjMoveStringLiteralDfa1_0(0x0L, 0x40L); + case 58: + return jjStopAtPos(0, 68); + case 59: + return jjStopAtPos(0, 57); + case 60: + jjmatchedKind = 87; + return jjMoveStringLiteralDfa1_0(0x0L, 0xa000400L); + case 61: + jjmatchedKind = 59; + return jjMoveStringLiteralDfa1_0(0x0L, 0x200000L); + case 62: + jjmatchedKind = 88; + return jjMoveStringLiteralDfa1_0(0x0L, 0x14000800L); + case 63: + return jjStopAtPos(0, 79); + case 91: + return jjStopAtPos(0, 62); + case 93: + return jjStopAtPos(0, 63); + case 94: + jjmatchedKind = 83; + return jjMoveStringLiteralDfa1_0(0x0L, 0x2000L); + case 97: + return jjMoveStringLiteralDfa1_0(0x200000000000L, 0x0L); + case 98: + return jjMoveStringLiteralDfa1_0(0x1000000000L, 0x0L); + case 99: + return jjMoveStringLiteralDfa1_0(0x20844000200000L, 0x0L); + case 100: + return jjMoveStringLiteralDfa1_0(0x1000000c000000L, 0x0L); + case 101: + return jjMoveStringLiteralDfa1_0(0x120080000000L, 0x0L); + case 102: + return jjMoveStringLiteralDfa1_0(0x2008000000000L, 0x0L); + case 103: + return jjMoveStringLiteralDfa1_0(0x1000000000000L, 0x0L); + case 105: + return jjMoveStringLiteralDfa1_0(0xc000000000000L, 0x0L); + case 108: + return jjMoveStringLiteralDfa1_0(0x80000000000L, 0x0L); + case 114: + return jjMoveStringLiteralDfa1_0(0x40800000L, 0x0L); + case 115: + return jjMoveStringLiteralDfa1_0(0x10730000000L, 0x0L); + case 116: + return jjMoveStringLiteralDfa1_0(0x2000000L, 0x0L); + case 117: + return jjMoveStringLiteralDfa1_0(0x2001000000L, 0x0L); + case 118: + return jjMoveStringLiteralDfa1_0(0x400000400000L, 0x0L); + case 119: + return jjMoveStringLiteralDfa1_0(0x800000000L, 0x0L); + case 123: + return jjStopAtPos(0, 66); + case 124: + jjmatchedKind = 82; + return jjMoveStringLiteralDfa1_0(0x0L, 0x14000L); + case 125: + return jjStopAtPos(0, 67); + case 126: + return jjStopAtPos(0, 99); + default : + return jjMoveNfa_0(0, 0); + } +} +static private int jjMoveStringLiteralDfa1_0(long active0, long active1){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0, active1); + return 1; + } + switch(curChar) + { + case 38: + if ((active1 & 0x20000L) != 0L) + return jjStopAtPos(1, 81); + break; + case 43: + if ((active1 & 0x200000000L) != 0L) + return jjStopAtPos(1, 97); + break; + case 45: + if ((active1 & 0x400000000L) != 0L) + return jjStopAtPos(1, 98); + break; + case 46: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2L); + case 60: + if ((active1 & 0x8000000L) != 0L) + { + jjmatchedKind = 91; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x400L); + case 61: + if ((active1 & 0x20L) != 0L) + return jjStopAtPos(1, 69); + else if ((active1 & 0x40L) != 0L) + return jjStopAtPos(1, 70); + else if ((active1 & 0x80L) != 0L) + return jjStopAtPos(1, 71); + else if ((active1 & 0x100L) != 0L) + return jjStopAtPos(1, 72); + else if ((active1 & 0x200L) != 0L) + return jjStopAtPos(1, 73); + else if ((active1 & 0x1000L) != 0L) + return jjStopAtPos(1, 76); + else if ((active1 & 0x2000L) != 0L) + return jjStopAtPos(1, 77); + else if ((active1 & 0x4000L) != 0L) + return jjStopAtPos(1, 78); + else if ((active1 & 0x200000L) != 0L) + return jjStopAtPos(1, 85); + else if ((active1 & 0x400000L) != 0L) + return jjStopAtPos(1, 86); + else if ((active1 & 0x2000000L) != 0L) + return jjStopAtPos(1, 89); + else if ((active1 & 0x4000000L) != 0L) + return jjStopAtPos(1, 90); + break; + case 62: + if ((active1 & 0x10000000L) != 0L) + { + jjmatchedKind = 92; + jjmatchedPos = 1; + } + else if ((active1 & 0x4000000000L) != 0L) + return jjStopAtPos(1, 102); + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x800L); + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000000L, active1, 0L); + case 101: + return jjMoveStringLiteralDfa2_0(active0, 0x44800000L, active1, 0L); + case 102: + if ((active0 & 0x8000000000000L) != 0L) + return jjStartNfaWithStates_0(1, 51, 41); + break; + case 104: + return jjMoveStringLiteralDfa2_0(active0, 0x810800000000L, active1, 0L); + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0x410000000L, active1, 0L); + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x28000000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x4102001000000L, active1, 0L); + case 111: + if ((active0 & 0x10000000000000L) != 0L) + { + jjmatchedKind = 52; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0x23484008600000L, active1, 0L); + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L); + case 116: + return jjMoveStringLiteralDfa2_0(active0, 0x300000000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L); + case 119: + return jjMoveStringLiteralDfa2_0(active0, 0x20000000L, active1, 0L); + case 120: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000L, active1, 0L); + case 121: + return jjMoveStringLiteralDfa2_0(active0, 0x2000000L, active1, 0L); + case 124: + if ((active1 & 0x10000L) != 0L) + return jjStopAtPos(1, 80); + break; + default : + break; + } + return jjStartNfa_0(0, active0, active1); +} +static private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(0, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0, active1); + return 2; + } + switch(curChar) + { + case 46: + if ((active1 & 0x2L) != 0L) + return jjStopAtPos(2, 65); + break; + case 61: + if ((active1 & 0x400L) != 0L) + return jjStopAtPos(2, 74); + else if ((active1 & 0x800L) != 0L) + return jjStopAtPos(2, 75); + break; + case 97: + return jjMoveStringLiteralDfa3_0(active0, 0x800200000000L, active1, 0L); + case 100: + return jjMoveStringLiteralDfa3_0(active0, 0x20000000000000L, active1, 0L); + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x1000000000L, active1, 0L); + case 102: + return jjMoveStringLiteralDfa3_0(active0, 0x4000000L, active1, 0L); + case 103: + return jjMoveStringLiteralDfa3_0(active0, 0x400800000L, active1, 0L); + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0x402820000000L, active1, 0L); + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x400000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa3_0(active0, 0x84000200000L, active1, 0L); + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0x18000000000L, active1, 0L); + case 112: + return jjMoveStringLiteralDfa3_0(active0, 0x2000000L, active1, 0L); + case 114: + if ((active0 & 0x2000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 49, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x100000000L, active1, 0L); + case 115: + return jjMoveStringLiteralDfa3_0(active0, 0x60001000000L, active1, 0L); + case 116: + if ((active0 & 0x4000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 50, 41); + return jjMoveStringLiteralDfa3_0(active0, 0x12000c0000000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa3_0(active0, 0x100008000000L, active1, 0L); + case 122: + return jjMoveStringLiteralDfa3_0(active0, 0x10000000L, active1, 0L); + default : + break; + } + return jjStartNfa_0(1, active0, active1); +} +static private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1){ + if (((active0 &= old0) | (active1 &= old1)) == 0L) + return jjStartNfa_0(1, old0, old1); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0, 0L); + return 3; + } + switch(curChar) + { + case 97: + return jjMoveStringLiteralDfa4_0(active0, 0x9004400000L); + case 98: + return jjMoveStringLiteralDfa4_0(active0, 0x8000000L); + case 100: + if ((active0 & 0x400000000000L) != 0L) + return jjStartNfaWithStates_0(3, 46, 41); + break; + case 101: + if ((active0 & 0x20000000000L) != 0L) + return jjStartNfaWithStates_0(3, 41, 41); + else if ((active0 & 0x40000000000L) != 0L) + return jjStartNfaWithStates_0(3, 42, 41); + else if ((active0 & 0x20000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 53, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x92000000L); + case 103: + if ((active0 & 0x80000000000L) != 0L) + return jjStartNfaWithStates_0(3, 43, 41); + break; + case 105: + return jjMoveStringLiteralDfa4_0(active0, 0x1800000L); + case 108: + return jjMoveStringLiteralDfa4_0(active0, 0x800000000L); + case 109: + if ((active0 & 0x100000000000L) != 0L) + return jjStartNfaWithStates_0(3, 44, 41); + break; + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x400000000L); + case 111: + if ((active0 & 0x200000000000L) != 0L) + return jjStartNfaWithStates_0(3, 45, 41); + else if ((active0 & 0x1000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 48, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L); + case 114: + if ((active0 & 0x800000000000L) != 0L) + return jjStartNfaWithStates_0(3, 47, 41); + return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L); + case 115: + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000L); + case 116: + return jjMoveStringLiteralDfa4_0(active0, 0x220200000L); + case 117: + return jjMoveStringLiteralDfa4_0(active0, 0x140000000L); + default : + break; + } + return jjStartNfa_0(2, active0, 0L); +} +static private int jjMoveStringLiteralDfa4_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(2, old0, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0, 0L); + return 4; + } + switch(curChar) + { + case 99: + return jjMoveStringLiteralDfa5_0(active0, 0x120000000L); + case 100: + return jjMoveStringLiteralDfa5_0(active0, 0x2000000L); + case 101: + if ((active0 & 0x800000000L) != 0L) + return jjStartNfaWithStates_0(4, 35, 41); + return jjMoveStringLiteralDfa5_0(active0, 0x400000000L); + case 103: + return jjMoveStringLiteralDfa5_0(active0, 0x1000000L); + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x200200000L); + case 107: + if ((active0 & 0x1000000000L) != 0L) + return jjStartNfaWithStates_0(4, 36, 41); + break; + case 108: + return jjMoveStringLiteralDfa5_0(active0, 0x8000000L); + case 110: + if ((active0 & 0x2000000000L) != 0L) + return jjStartNfaWithStates_0(4, 37, 41); + break; + case 111: + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L); + case 114: + return jjMoveStringLiteralDfa5_0(active0, 0xc0000000L); + case 115: + return jjMoveStringLiteralDfa5_0(active0, 0x800000L); + case 116: + if ((active0 & 0x4000000000L) != 0L) + return jjStartNfaWithStates_0(4, 38, 41); + else if ((active0 & 0x8000000000L) != 0L) + return jjStartNfaWithStates_0(4, 39, 41); + else if ((active0 & 0x10000000000L) != 0L) + return jjStartNfaWithStates_0(4, 40, 41); + return jjMoveStringLiteralDfa5_0(active0, 0x400000L); + case 117: + return jjMoveStringLiteralDfa5_0(active0, 0x4000000L); + default : + break; + } + return jjStartNfa_0(3, active0, 0L); +} +static private int jjMoveStringLiteralDfa5_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(3, old0, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0, 0L); + return 5; + } + switch(curChar) + { + case 99: + if ((active0 & 0x200000000L) != 0L) + return jjStartNfaWithStates_0(5, 33, 41); + break; + case 100: + if ((active0 & 0x400000000L) != 0L) + return jjStartNfaWithStates_0(5, 34, 41); + break; + case 101: + if ((active0 & 0x8000000L) != 0L) + return jjStartNfaWithStates_0(5, 27, 41); + return jjMoveStringLiteralDfa6_0(active0, 0x2000000L); + case 102: + if ((active0 & 0x10000000L) != 0L) + return jjStartNfaWithStates_0(5, 28, 41); + break; + case 104: + if ((active0 & 0x20000000L) != 0L) + return jjStartNfaWithStates_0(5, 29, 41); + break; + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x400000L); + case 108: + return jjMoveStringLiteralDfa6_0(active0, 0x4000000L); + case 110: + if ((active0 & 0x40000000L) != 0L) + return jjStartNfaWithStates_0(5, 30, 41); + else if ((active0 & 0x80000000L) != 0L) + return jjStartNfaWithStates_0(5, 31, 41); + return jjMoveStringLiteralDfa6_0(active0, 0x1200000L); + case 116: + if ((active0 & 0x100000000L) != 0L) + return jjStartNfaWithStates_0(5, 32, 41); + return jjMoveStringLiteralDfa6_0(active0, 0x800000L); + default : + break; + } + return jjStartNfa_0(4, active0, 0L); +} +static private int jjMoveStringLiteralDfa6_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(4, old0, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0, 0L); + return 6; + } + switch(curChar) + { + case 101: + return jjMoveStringLiteralDfa7_0(active0, 0x1800000L); + case 102: + if ((active0 & 0x2000000L) != 0L) + return jjStartNfaWithStates_0(6, 25, 41); + break; + case 108: + return jjMoveStringLiteralDfa7_0(active0, 0x400000L); + case 116: + if ((active0 & 0x4000000L) != 0L) + return jjStartNfaWithStates_0(6, 26, 41); + break; + case 117: + return jjMoveStringLiteralDfa7_0(active0, 0x200000L); + default : + break; + } + return jjStartNfa_0(5, active0, 0L); +} +static private int jjMoveStringLiteralDfa7_0(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(5, old0, 0L); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0, 0L); + return 7; + } + switch(curChar) + { + case 100: + if ((active0 & 0x1000000L) != 0L) + return jjStartNfaWithStates_0(7, 24, 41); + break; + case 101: + if ((active0 & 0x200000L) != 0L) + return jjStartNfaWithStates_0(7, 21, 41); + else if ((active0 & 0x400000L) != 0L) + return jjStartNfaWithStates_0(7, 22, 41); + break; + case 114: + if ((active0 & 0x800000L) != 0L) + return jjStartNfaWithStates_0(7, 23, 41); + break; + default : + break; + } + return jjStartNfa_0(6, active0, 0L); +} +static private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 73; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 0: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(0, 6); } + else if (curChar == 47) + { jjAddStates(7, 8); } + else if (curChar == 36) + { + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + } + else if (curChar == 34) + { jjCheckNAddStates(9, 11); } + else if (curChar == 39) + { jjAddStates(12, 13); } + else if (curChar == 46) + { jjCheckNAdd(4); } + if ((0x3fe000000000000L & l) != 0L) + { + if (kind > 12) + kind = 12; + { jjCheckNAddTwoStates(1, 2); } + } + else if (curChar == 48) + { + if (kind > 12) + kind = 12; + { jjCheckNAddStates(14, 16); } + } + break; + case 62: + if (curChar == 42) + { jjCheckNAddTwoStates(68, 69); } + else if (curChar == 47) + { jjCheckNAddStates(17, 19); } + break; + case 38: + case 41: + if ((0x3ff001000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + break; + case 37: + if ((0x3ff001000000000L & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + break; + case 1: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 12) + kind = 12; + { jjCheckNAddTwoStates(1, 2); } + break; + case 3: + if (curChar == 46) + { jjCheckNAdd(4); } + break; + case 4: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddStates(20, 22); } + break; + case 6: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(7); } + break; + case 7: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddTwoStates(7, 8); } + break; + case 9: + if (curChar == 39) + { jjAddStates(12, 13); } + break; + case 10: + if ((0xffffff7fffffdbffL & l) != 0L) + { jjCheckNAdd(11); } + break; + case 11: + if (curChar == 39 && kind > 18) + kind = 18; + break; + case 13: + if ((0x8400000000L & l) != 0L) + { jjCheckNAdd(11); } + break; + case 14: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(15, 11); } + break; + case 15: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(11); } + break; + case 16: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 17; + break; + case 17: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(15); } + break; + case 18: + if (curChar == 34) + { jjCheckNAddStates(9, 11); } + break; + case 19: + if ((0xfffffffbffffdbffL & l) != 0L) + { jjCheckNAddStates(9, 11); } + break; + case 21: + if ((0x8400002400L & l) != 0L) + { jjCheckNAddStates(9, 11); } + break; + case 22: + if (curChar == 34 && kind > 19) + kind = 19; + break; + case 23: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddStates(23, 26); } + break; + case 24: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAddStates(9, 11); } + break; + case 25: + if ((0xf000000000000L & l) != 0L) + jjstateSet[jjnewStateCnt++] = 26; + break; + case 26: + if ((0xff000000000000L & l) != 0L) + { jjCheckNAdd(24); } + break; + case 27: + if (curChar == 10) + { jjCheckNAddStates(9, 11); } + break; + case 28: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 27; + break; + case 30: + if ((0x3fe000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAdd(31); } + break; + case 31: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 20) + kind = 20; + { jjCheckNAdd(31); } + break; + case 40: + if (curChar != 36) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + break; + case 42: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(0, 6); } + break; + case 43: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(43, 44); } + break; + case 44: + if (curChar != 46) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddStates(27, 29); } + break; + case 45: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddStates(27, 29); } + break; + case 47: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(48); } + break; + case 48: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddTwoStates(48, 8); } + break; + case 49: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(49, 50); } + break; + case 51: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(52); } + break; + case 52: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 16) + kind = 16; + { jjCheckNAddTwoStates(52, 8); } + break; + case 53: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddStates(30, 32); } + break; + case 55: + if ((0x280000000000L & l) != 0L) + { jjCheckNAdd(56); } + break; + case 56: + if ((0x3ff000000000000L & l) != 0L) + { jjCheckNAddTwoStates(56, 8); } + break; + case 57: + if (curChar != 48) + break; + if (kind > 12) + kind = 12; + { jjCheckNAddStates(14, 16); } + break; + case 59: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 12) + kind = 12; + { jjCheckNAddTwoStates(59, 2); } + break; + case 60: + if ((0xff000000000000L & l) == 0L) + break; + if (kind > 12) + kind = 12; + { jjCheckNAddTwoStates(60, 2); } + break; + case 61: + if (curChar == 47) + { jjAddStates(7, 8); } + break; + case 63: + if ((0xffffffffffffdbffL & l) != 0L) + { jjCheckNAddStates(17, 19); } + break; + case 64: + if ((0x2400L & l) != 0L && kind > 5) + kind = 5; + break; + case 65: + if (curChar == 10 && kind > 5) + kind = 5; + break; + case 66: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 65; + break; + case 67: + if (curChar == 42) + { jjCheckNAddTwoStates(68, 69); } + break; + case 68: + if ((0xfffffbffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(68, 69); } + break; + case 69: + if (curChar == 42) + { jjCheckNAddStates(33, 35); } + break; + case 70: + if ((0xffff7bffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(71, 69); } + break; + case 71: + if ((0xfffffbffffffffffL & l) != 0L) + { jjCheckNAddTwoStates(71, 69); } + break; + case 72: + if (curChar == 47 && kind > 6) + kind = 6; + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 0: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + } + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 38: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + } + if (curChar == 110) + jjstateSet[jjnewStateCnt++] = 37; + break; + case 37: + if ((0x7fffffe87fffffeL & l) != 0L) + { + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + } + if (curChar == 100) + jjstateSet[jjnewStateCnt++] = 36; + break; + case 2: + if ((0x100000001000L & l) != 0L && kind > 12) + kind = 12; + break; + case 5: + if ((0x2000000020L & l) != 0L) + { jjAddStates(36, 37); } + break; + case 8: + if ((0x5000000050L & l) != 0L && kind > 16) + kind = 16; + break; + case 10: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAdd(11); } + break; + case 12: + if (curChar == 92) + { jjAddStates(38, 40); } + break; + case 13: + if ((0x14404410000000L & l) != 0L) + { jjCheckNAdd(11); } + break; + case 19: + if ((0xffffffffefffffffL & l) != 0L) + { jjCheckNAddStates(9, 11); } + break; + case 20: + if (curChar == 92) + { jjAddStates(41, 44); } + break; + case 21: + if ((0x14404410000000L & l) != 0L) + { jjCheckNAddStates(9, 11); } + break; + case 29: + if (curChar != 100) + break; + if (kind > 20) + kind = 20; + jjstateSet[jjnewStateCnt++] = 30; + break; + case 32: + if (curChar == 101) + jjstateSet[jjnewStateCnt++] = 29; + break; + case 33: + if (curChar == 110) + jjstateSet[jjnewStateCnt++] = 32; + break; + case 34: + if (curChar == 105) + jjstateSet[jjnewStateCnt++] = 33; + break; + case 35: + if (curChar == 102) + jjstateSet[jjnewStateCnt++] = 34; + break; + case 36: + if (curChar == 101) + jjstateSet[jjnewStateCnt++] = 35; + break; + case 39: + if (curChar == 117) + jjstateSet[jjnewStateCnt++] = 38; + break; + case 40: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + break; + case 41: + if ((0x7fffffe87fffffeL & l) == 0L) + break; + if (kind > 54) + kind = 54; + { jjCheckNAdd(41); } + break; + case 46: + if ((0x2000000020L & l) != 0L) + { jjAddStates(45, 46); } + break; + case 50: + if ((0x2000000020L & l) != 0L) + { jjAddStates(47, 48); } + break; + case 54: + if ((0x2000000020L & l) != 0L) + { jjAddStates(49, 50); } + break; + case 58: + if ((0x100000001000000L & l) != 0L) + { jjCheckNAdd(59); } + break; + case 59: + if ((0x7e0000007eL & l) == 0L) + break; + if (kind > 12) + kind = 12; + { jjCheckNAddTwoStates(59, 2); } + break; + case 63: + { jjAddStates(17, 19); } + break; + case 68: + { jjCheckNAddTwoStates(68, 69); } + break; + case 70: + case 71: + { jjCheckNAddTwoStates(71, 69); } + break; + default : break; + } + } while(i != startsAt); + } + else + { + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 10: + if ((jjbitVec0[i2] & l2) != 0L) + jjstateSet[jjnewStateCnt++] = 11; + break; + case 19: + if ((jjbitVec0[i2] & l2) != 0L) + { jjAddStates(9, 11); } + break; + case 63: + if ((jjbitVec0[i2] & l2) != 0L) + { jjAddStates(17, 19); } + break; + case 68: + if ((jjbitVec0[i2] & l2) != 0L) + { jjCheckNAddTwoStates(68, 69); } + break; + case 70: + case 71: + if ((jjbitVec0[i2] & l2) != 0L) + { jjCheckNAddTwoStates(71, 69); } + break; + default : break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 73 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +static private int jjMoveStringLiteralDfa0_1(){ + switch(curChar) + { + case 10: + return jjStopAtPos(0, 8); + case 92: + return jjMoveStringLiteralDfa1_1(0x600L); + default : + return 1; + } +} +static private int jjMoveStringLiteralDfa1_1(long active0){ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 1; + } + switch(curChar) + { + case 10: + if ((active0 & 0x200L) != 0L) + return jjStopAtPos(1, 9); + break; + case 13: + return jjMoveStringLiteralDfa2_1(active0, 0x400L); + default : + return 2; + } + return 2; +} +static private int jjMoveStringLiteralDfa2_1(long old0, long active0){ + if (((active0 &= old0)) == 0L) + return 2; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + return 2; + } + switch(curChar) + { + case 10: + if ((active0 & 0x400L) != 0L) + return jjStopAtPos(2, 10); + break; + default : + return 3; + } + return 3; +} + +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, null, null, null, null, null, null, +null, null, null, null, null, null, null, null, "\143\157\156\164\151\156\165\145", +"\166\157\154\141\164\151\154\145", "\162\145\147\151\163\164\145\162", "\165\156\163\151\147\156\145\144", +"\164\171\160\145\144\145\146", "\144\145\146\141\165\154\164", "\144\157\165\142\154\145", +"\163\151\172\145\157\146", "\163\167\151\164\143\150", "\162\145\164\165\162\156", +"\145\170\164\145\162\156", "\163\164\162\165\143\164", "\163\164\141\164\151\143", +"\163\151\147\156\145\144", "\167\150\151\154\145", "\142\162\145\141\153", "\165\156\151\157\156", +"\143\157\156\163\164", "\146\154\157\141\164", "\163\150\157\162\164", "\145\154\163\145", +"\143\141\163\145", "\154\157\156\147", "\145\156\165\155", "\141\165\164\157", +"\166\157\151\144", "\143\150\141\162", "\147\157\164\157", "\146\157\162", "\151\156\164", +"\151\146", "\144\157", "\143\157\144\145", null, null, null, "\73", "\54", "\75", "\50", +"\51", "\133", "\135", "\52", "\56\56\56", "\173", "\175", "\72", "\52\75", "\57\75", +"\45\75", "\53\75", "\55\75", "\74\74\75", "\76\76\75", "\46\75", "\136\75", "\174\75", +"\77", "\174\174", "\46\46", "\174", "\136", "\46", "\75\75", "\41\75", "\74", "\76", +"\74\75", "\76\75", "\74\74", "\76\76", "\53", "\55", "\57", "\45", "\53\53", "\55\55", +"\176", "\41", "\56", "\55\76", }; +static protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = Token.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} +static final int[] jjnextStates = { + 43, 44, 49, 50, 53, 54, 8, 62, 67, 19, 20, 22, 10, 12, 58, 60, + 2, 63, 64, 66, 4, 5, 8, 19, 20, 24, 22, 45, 46, 8, 53, 54, + 8, 69, 70, 72, 6, 7, 13, 14, 16, 21, 23, 25, 28, 47, 48, 51, + 52, 55, 56, +}; + +static int curLexState = 0; +static int defaultLexState = 0; +static int jjnewStateCnt; +static int jjround; +static int jjmatchedPos; +static int jjmatchedKind; + +/** Get the next Token. */ +public static Token getNextToken() +{ + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(Exception e) + { + jjmatchedKind = 0; + jjmatchedPos = -1; + matchedToken = jjFillToken(); + return matchedToken; + } + + for (;;) + { + switch(curLexState) + { + case 0: + try { input_stream.backup(0); + while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L) + curChar = input_stream.BeginToken(); + } + catch (java.io.IOException e1) { continue EOFLoop; } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 11) + { + jjmatchedKind = 11; + } + break; + } + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + return matchedToken; + } + else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + continue EOFLoop; + } + if (jjnewLexState[jjmatchedKind] != -1) + curLexState = jjnewLexState[jjmatchedKind]; + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; + } + catch (java.io.IOException e1) { } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } +} + +static void SkipLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +static void MoreLexicalActions() +{ + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch(jjmatchedKind) + { + default : + break; + } +} +static void TokenLexicalActions(Token matchedToken) +{ + switch(jjmatchedKind) + { + default : + break; + } +} +static private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +static private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +static private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +static private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + + /** Constructor. */ + public CParserTokenManager(SimpleCharStream stream){ + + if (input_stream != null) + throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR); + + input_stream = stream; + } + + /** Constructor. */ + public CParserTokenManager (SimpleCharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + + static public void ReInit(SimpleCharStream stream) + { + + + jjmatchedPos = + jjnewStateCnt = + 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + static private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 73; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + static public void ReInit(SimpleCharStream stream, int lexState) + + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public static void SwitchTo(int lexState) + { + if (lexState >= 2 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", + "PREPROCESSOR_OUTPUT", +}; + +/** Lex State array. */ +public static final int[] jjnewLexState = { + -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, +}; +static final long[] jjtoToken = { + 0xfe7ffffffffd1001L, 0x7fffffffffL, +}; +static final long[] jjtoSkip = { + 0x1feL, 0x0L, +}; +static final long[] jjtoSpecial = { + 0x0L, 0x0L, +}; +static final long[] jjtoMore = { + 0xe00L, 0x0L, +}; + static protected SimpleCharStream input_stream; + + static private final int[] jjrounds = new int[73]; + static private final int[] jjstateSet = new int[2 * 73]; + private static final StringBuilder jjimage = new StringBuilder(); + private static StringBuilder image = jjimage; + private static int jjimageLen; + private static int lengthOfMatch; + static protected int curChar; +} diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTreeConstants.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTreeConstants.java new file mode 100644 index 0000000..0d972cd --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserTreeConstants.java @@ -0,0 +1,115 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. CParserTreeConstants.java Version 7.0.9 */ +public interface CParserTreeConstants +{ + public int JJTFUNCTIONDEFINITION = 0; + public int JJTDECLARATION = 1; + public int JJTDECLARATIONLIST = 2; + public int JJTDECLARATIONSPECIFIERS = 3; + public int JJTGHOSTSTRINGTOKEN = 4; + public int JJTTYPESTRINGTOKEN = 5; + public int JJTSTRINGTOKEN = 6; + public int JJTINITDECLARATORLIST = 7; + public int JJTINITDECLARATOR = 8; + public int JJTSPECIFIERQUALIFIERLIST = 9; + public int JJTDECLARATOR = 10; + public int JJTDIRECTDECLARATOR = 11; + public int JJTPOINTER = 12; + public int JJTTYPEQUALIFIERLIST = 13; + public int JJTPARAMETERTYPELIST = 14; + public int JJTPARAMETERLIST = 15; + public int JJTPARAMETERDECLARATION = 16; + public int JJTIDENTIFIERLIST = 17; + public int JJTINITIALIZER = 18; + public int JJTINITIALIZERLIST = 19; + public int JJTTYPENAME = 20; + public int JJTABSTRACTDECLARATOR = 21; + public int JJTDIRECTABSTRACTDECLARATOR = 22; + public int JJTSTATEMENT = 23; + public int JJTLABELEDSTATEMENT = 24; + public int JJTEXPRESSIONSTATEMENT = 25; + public int JJTCOMPOUNDSTATEMENT = 26; + public int JJTSTATEMENTLIST = 27; + public int JJTSELECTIONSTATEMENT = 28; + public int JJTITERATIONSTATEMENT = 29; + public int JJTJUMPSTATEMENT = 30; + public int JJTEXPRESSION = 31; + public int JJTASSIGNMENTEXPRESSION = 32; + public int JJTASSIGNMENTOPERATOR = 33; + public int JJTCONDITIONALEXPRESSION = 34; + public int JJTCONSTANTEXPRESSION = 35; + public int JJTLOGICALOREXPRESSION = 36; + public int JJTLOGICALANDEXPRESSION = 37; + public int JJTINCLUSIVEOREXPRESSION = 38; + public int JJTEXCLUSIVEOREXPRESSION = 39; + public int JJTANDEXPRESSION = 40; + public int JJTEQUALITYEXPRESSION = 41; + public int JJTRELATIONALEXPRESSION = 42; + public int JJTSHIFTEXPRESSION = 43; + public int JJTADDITIVEEXPRESSION = 44; + public int JJTMULTIPLICATIVEEXPRESSION = 45; + public int JJTCASTEXPRESSION = 46; + public int JJTUNARYEXPRESSION = 47; + public int JJTUNARYOPERATOR = 48; + public int JJTPOSTFIXEXPRESSION = 49; + public int JJTPRIMARYEXPRESSION = 50; + public int JJTARGUMENTEXPRESSIONLIST = 51; + + + public String[] jjtNodeName = { + "FunctionDefinition", + "Declaration", + "DeclarationList", + "DeclarationSpecifiers", + "GhostStringToken", + "TypeStringToken", + "StringToken", + "InitDeclaratorList", + "InitDeclarator", + "SpecifierQualifierList", + "Declarator", + "DirectDeclarator", + "Pointer", + "TypeQualifierList", + "ParameterTypeList", + "ParameterList", + "ParameterDeclaration", + "IdentifierList", + "Initializer", + "InitializerList", + "TypeName", + "AbstractDeclarator", + "DirectAbstractDeclarator", + "Statement", + "LabeledStatement", + "ExpressionStatement", + "CompoundStatement", + "StatementList", + "SelectionStatement", + "IterationStatement", + "JumpStatement", + "Expression", + "AssignmentExpression", + "AssignmentOperator", + "ConditionalExpression", + "ConstantExpression", + "LogicalORExpression", + "LogicalANDExpression", + "InclusiveORExpression", + "ExclusiveORExpression", + "ANDExpression", + "EqualityExpression", + "RelationalExpression", + "ShiftExpression", + "AdditiveExpression", + "MultiplicativeExpression", + "CastExpression", + "UnaryExpression", + "UnaryOperator", + "PostfixExpression", + "PrimaryExpression", + "ArgumentExpressionList", + }; +} +/* JavaCC - OriginalChecksum=6481848a6a13fcbf09c2152866d8e998 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/CParserVisitor.java b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserVisitor.java new file mode 100644 index 0000000..bc9b072 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/CParserVisitor.java @@ -0,0 +1,60 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. CParserVisitor.java Version 7.0.9 */ +public interface CParserVisitor +{ + public Object visit(SimpleNode node, Object data); + public Object visit(ASTFunctionDefinition node, Object data); + public Object visit(ASTDeclaration node, Object data); + public Object visit(ASTDeclarationList node, Object data); + public Object visit(ASTDeclarationSpecifiers node, Object data); + public Object visit(ASTGhostStringToken node, Object data); + public Object visit(ASTTypeStringToken node, Object data); + public Object visit(ASTStringToken node, Object data); + public Object visit(ASTInitDeclaratorList node, Object data); + public Object visit(ASTInitDeclarator node, Object data); + public Object visit(ASTSpecifierQualifierList node, Object data); + public Object visit(ASTDeclarator node, Object data); + public Object visit(ASTDirectDeclarator node, Object data); + public Object visit(ASTPointer node, Object data); + public Object visit(ASTTypeQualifierList node, Object data); + public Object visit(ASTParameterTypeList node, Object data); + public Object visit(ASTParameterList node, Object data); + public Object visit(ASTParameterDeclaration node, Object data); + public Object visit(ASTIdentifierList node, Object data); + public Object visit(ASTInitializer node, Object data); + public Object visit(ASTInitializerList node, Object data); + public Object visit(ASTTypeName node, Object data); + public Object visit(ASTAbstractDeclarator node, Object data); + public Object visit(ASTDirectAbstractDeclarator node, Object data); + public Object visit(ASTStatement node, Object data); + public Object visit(ASTLabeledStatement node, Object data); + public Object visit(ASTExpressionStatement node, Object data); + public Object visit(ASTCompoundStatement node, Object data); + public Object visit(ASTStatementList node, Object data); + public Object visit(ASTSelectionStatement node, Object data); + public Object visit(ASTIterationStatement node, Object data); + public Object visit(ASTJumpStatement node, Object data); + public Object visit(ASTExpression node, Object data); + public Object visit(ASTAssignmentExpression node, Object data); + public Object visit(ASTAssignmentOperator node, Object data); + public Object visit(ASTConditionalExpression node, Object data); + public Object visit(ASTConstantExpression node, Object data); + public Object visit(ASTLogicalORExpression node, Object data); + public Object visit(ASTLogicalANDExpression node, Object data); + public Object visit(ASTInclusiveORExpression node, Object data); + public Object visit(ASTExclusiveORExpression node, Object data); + public Object visit(ASTANDExpression node, Object data); + public Object visit(ASTEqualityExpression node, Object data); + public Object visit(ASTRelationalExpression node, Object data); + public Object visit(ASTShiftExpression node, Object data); + public Object visit(ASTAdditiveExpression node, Object data); + public Object visit(ASTMultiplicativeExpression node, Object data); + public Object visit(ASTCastExpression node, Object data); + public Object visit(ASTUnaryExpression node, Object data); + public Object visit(ASTUnaryOperator node, Object data); + public Object visit(ASTPostfixExpression node, Object data); + public Object visit(ASTPrimaryExpression node, Object data); + public Object visit(ASTArgumentExpressionList node, Object data); +} +/* JavaCC - OriginalChecksum=268378ad65a278fa22d6bd4787195a5f (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/JJTCParserState.java b/src/main/java/ghidrust/decompiler/parser/c/gen/JJTCParserState.java new file mode 100644 index 0000000..5c6e526 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/JJTCParserState.java @@ -0,0 +1,123 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. JJTCParserState.java Version 7.0.9 */ +public class JJTCParserState { + private java.util.List nodes; + private java.util.List marks; + + private int sp; // number of nodes on stack + private int mk; // current mark + private boolean node_created; + + public JJTCParserState() { + nodes = new java.util.ArrayList(); + marks = new java.util.ArrayList(); + sp = 0; + mk = 0; + } + + /* Determines whether the current node was actually closed and + pushed. This should only be called in the final user action of a + node scope. */ + public boolean nodeCreated() { + return node_created; + } + + /* Call this to reinitialize the node stack. It is called + automatically by the parser's ReInit() method. */ + public void reset() { + nodes.clear(); + marks.clear(); + sp = 0; + mk = 0; + } + + /* Returns the root node of the AST. It only makes sense to call + this after a successful parse. */ + public Node rootNode() { + return nodes.get(0); + } + + /* Pushes a node on to the stack. */ + public void pushNode(Node n) { + nodes.add(n); + ++sp; + } + + /* Returns the node on the top of the stack, and remove it from the + stack. */ + public Node popNode() { + if (--sp < mk) { + mk = marks.remove(marks.size()-1); + } + return nodes.remove(nodes.size()-1); + } + + /* Returns the node currently on the top of the stack. */ + public Node peekNode() { + return nodes.get(nodes.size()-1); + } + + /* Returns the number of children on the stack in the current node + scope. */ + public int nodeArity() { + return sp - mk; + } + + + public void clearNodeScope(Node n) { + while (sp > mk) { + popNode(); + } + mk = marks.remove(marks.size()-1); + } + + + public void openNodeScope(Node n) { + marks.add(mk); + mk = sp; + n.jjtOpen(); + } + + + /* A definite node is constructed from a specified number of + children. That number of nodes are popped from the stack and + made the children of the definite node. Then the definite node + is pushed on to the stack. */ + public void closeNodeScope(Node n, int num) { + mk = marks.remove(marks.size()-1); + while (num-- > 0) { + Node c = popNode(); + c.jjtSetParent(n); + n.jjtAddChild(c, num); + } + n.jjtClose(); + pushNode(n); + node_created = true; + } + + + /* A conditional node is constructed if its condition is true. All + the nodes that have been pushed since the node was opened are + made children of the conditional node, which is then pushed + on to the stack. If the condition is false the node is not + constructed and they are left on the stack. */ + public void closeNodeScope(Node n, boolean condition) { + if (condition) { + int a = nodeArity(); + mk = marks.remove(marks.size()-1); + while (a-- > 0) { + Node c = popNode(); + c.jjtSetParent(n); + n.jjtAddChild(c, a); + } + n.jjtClose(); + pushNode(n); + node_created = true; + } else { + mk = marks.remove(marks.size()-1); + node_created = false; + } + } +} +/* JavaCC - OriginalChecksum=ab6c16d936495b21e639077683ccf423 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/Node.java b/src/main/java/ghidrust/decompiler/parser/c/gen/Node.java new file mode 100644 index 0000000..e05d5fb --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/Node.java @@ -0,0 +1,41 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. Node.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +/* All AST nodes must implement this interface. It provides basic + machinery for constructing the parent and child relationships + between nodes. */ + +public +interface Node { + + /** This method is called after the node has been made the current + node. It indicates that child nodes can now be added to it. */ + public void jjtOpen(); + + /** This method is called after all the child nodes have been + added. */ + public void jjtClose(); + + /** This pair of methods are used to inform the node of its + parent. */ + public void jjtSetParent(Node n); + public Node jjtGetParent(); + + /** This method tells the node to add its argument to the node's + list of children. */ + public void jjtAddChild(Node n, int i); + + /** This method returns a child node. The children are numbered + from zero, left to right. */ + public Node jjtGetChild(int i); + + /** Return the number of children the node has. */ + public int jjtGetNumChildren(); + + public int getId(); + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data); +} +/* JavaCC - OriginalChecksum=93c32f64ec01c5821c3fb11c9d59d33b (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/ParseException.java b/src/main/java/ghidrust/decompiler/parser/c/gen/ParseException.java new file mode 100644 index 0000000..6102ea1 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/ParseException.java @@ -0,0 +1,193 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */ +/* JavaCCOptions:KEEP_LINE_COLUMN=true */ +/** + * This exception is thrown when parse errors are encountered. + * You can explicitly create objects of this exception type by + * calling the method generateParseException in the generated + * parser. + * + * You can modify this class to customize your error reporting + * mechanisms so long as you retain the public fields. + */ +public class ParseException extends Exception { + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * The end of line string for this machine. + */ + protected static String EOL = System.getProperty("line.separator", "\n"); + + /** + * This constructor is used by the method "generateParseException" + * in the generated parser. Calling this constructor generates + * a new object of this type with the fields "currentToken", + * "expectedTokenSequences", and "tokenImage" set. + */ + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal + ) + { + super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); + currentToken = currentTokenVal; + expectedTokenSequences = expectedTokenSequencesVal; + tokenImage = tokenImageVal; + } + + /** + * The following constructors are for use by you for whatever + * purpose you can think of. Constructing the exception in this + * manner makes the exception behave in the normal way - i.e., as + * documented in the class "Throwable". The fields "errorToken", + * "expectedTokenSequences", and "tokenImage" do not contain + * relevant information. The JavaCC generated code does not use + * these constructors. + */ + + public ParseException() { + super(); + } + + /** Constructor with message. */ + public ParseException(String message) { + super(message); + } + + + /** + * This is the last token that has been consumed successfully. If + * this object has been created due to a parse error, the token + * following this token will (therefore) be the first error token. + */ + public Token currentToken; + + /** + * Each entry in this array is an array of integers. Each array + * of integers represents a sequence of tokens (by their ordinal + * values) that is expected at this point of the parse. + */ + public int[][] expectedTokenSequences; + + /** + * This is a reference to the "tokenImage" array of the generated + * parser within which the parse error occurred. This array is + * defined in the generated ...Constants interface. + */ + public String[] tokenImage; + + /** + * It uses "currentToken" and "expectedTokenSequences" to generate a parse + * error message and returns it. If this object has been created + * due to a parse error, and you do not catch it (it gets thrown + * from the parser) the correct error message + * gets displayed. + */ + private static String initialise(Token currentToken, + int[][] expectedTokenSequences, + String[] tokenImage) { + + StringBuilder expected = new StringBuilder(); + int maxSize = 0; + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; + } + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); + } + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + expected.append("..."); + } + expected.append(EOL).append(" "); + } + String retval = "Encountered \""; + Token tok = currentToken.next; + for (int i = 0; i < maxSize; i++) { + if (i != 0) retval += " "; + if (tok.kind == 0) { + retval += tokenImage[0]; + break; + } + retval += " " + tokenImage[tok.kind]; + retval += " \""; + retval += add_escapes(tok.image); + retval += " \""; + tok = tok.next; + } + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; + retval += "." + EOL; + + + if (expectedTokenSequences.length == 0) { + // Nothing to add here + } else { + if (expectedTokenSequences.length == 1) { + retval += "Was expecting:" + EOL + " "; + } else { + retval += "Was expecting one of:" + EOL + " "; + } + retval += expected.toString(); + } + + return retval; + } + + + /** + * Used to convert raw characters to their escaped version + * when these raw version cannot be used as part of an ASCII + * string literal. + */ + static String add_escapes(String str) { + StringBuilder retval = new StringBuilder(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } + } + return retval.toString(); + } + +} +/* JavaCC - OriginalChecksum=0fbdc1f3a882b6ef66ce3f2a7a0e4228 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleCharStream.java b/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleCharStream.java new file mode 100644 index 0000000..700f448 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleCharStream.java @@ -0,0 +1,478 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 7.0 */ +/* JavaCCOptions:STATIC=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +/** + * An implementation of interface CharStream, where the stream is assumed to + * contain only ASCII characters (without unicode processing). + */ + +public class SimpleCharStream +{ +/** Whether parser is static. */ + public static final boolean staticFlag = true; + static int bufsize; + static int available; + static int tokenBegin; +/** Position in buffer. */ + static public int bufpos = -1; + static protected int bufline[]; + static protected int bufcolumn[]; + + static protected int column = 0; + static protected int line = 1; + + static protected boolean prevCharIsCR = false; + static protected boolean prevCharIsLF = false; + + static protected java.io.Reader inputStream; + + static protected char[] buffer; + static protected int maxNextCharInd = 0; + static protected int inBuf = 0; + static protected int tabSize = 1; + static protected boolean trackLineColumn = true; + + static public void setTabSize(int i) { tabSize = i; } + static public int getTabSize() { return tabSize; } + + + + static protected void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; + + try + { + if (wrapAround) + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + maxNextCharInd = (bufpos += (bufsize - tokenBegin)); + } + else + { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; + + maxNextCharInd = (bufpos -= tokenBegin); + } + } + catch (Throwable t) + { + throw new Error(t.getMessage()); + } + + + bufsize += 2048; + available = bufsize; + tokenBegin = 0; + } + + static protected void FillBuff() throws java.io.IOException + { + if (maxNextCharInd == available) + { + if (available == bufsize) + { + if (tokenBegin > 2048) + { + bufpos = maxNextCharInd = 0; + available = tokenBegin; + } + else if (tokenBegin < 0) + bufpos = maxNextCharInd = 0; + else + ExpandBuff(false); + } + else if (available > tokenBegin) + available = bufsize; + else if ((tokenBegin - available) < 2048) + ExpandBuff(true); + else + available = tokenBegin; + } + + int i; + try { + if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1) + { + inputStream.close(); + throw new java.io.IOException(); + } + else + maxNextCharInd += i; + return; + } + catch(java.io.IOException e) { + --bufpos; + backup(0); + if (tokenBegin == -1) + tokenBegin = bufpos; + throw e; + } + } + +/** Start. */ + static public char BeginToken() throws java.io.IOException + { + tokenBegin = -1; + char c = readChar(); + tokenBegin = bufpos; + + return c; + } + + static protected void UpdateLineColumn(char c) + { + column++; + + if (prevCharIsLF) + { + prevCharIsLF = false; + line += (column = 1); + } + else if (prevCharIsCR) + { + prevCharIsCR = false; + if (c == '\n') + { + prevCharIsLF = true; + } + else + line += (column = 1); + } + + switch (c) + { + case '\r' : + prevCharIsCR = true; + break; + case '\n' : + prevCharIsLF = true; + break; + case '\t' : + column--; + column += (tabSize - (column % tabSize)); + break; + default : + break; + } + + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + +/** Read a character. */ + static public char readChar() throws java.io.IOException + { + if (inBuf > 0) + { + --inBuf; + + if (++bufpos == bufsize) + bufpos = 0; + + return buffer[bufpos]; + } + + if (++bufpos >= maxNextCharInd) + FillBuff(); + + char c = buffer[bufpos]; + + UpdateLineColumn(c); + return c; + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + + static public int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + + static public int getLine() { + return bufline[bufpos]; + } + + /** Get token end column number. */ + static public int getEndColumn() { + return bufcolumn[bufpos]; + } + + /** Get token end line number. */ + static public int getEndLine() { + return bufline[bufpos]; + } + + /** Get token beginning column number. */ + static public int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + + /** Get token beginning line number. */ + static public int getBeginLine() { + return bufline[tokenBegin]; + } + +/** Backup a number of characters. */ + static public void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) + bufpos += bufsize; + } + + /** Constructor. */ + public SimpleCharStream(java.io.Reader dstream, int startline, + int startcolumn, int buffersize) + { + if (inputStream != null) + throw new Error("\n ERROR: Second call to the constructor of a static SimpleCharStream.\n" + + " You must either use ReInit() or set the JavaCC option STATIC to false\n" + + " during the generation of this class."); + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + } + + /** Constructor. */ + public SimpleCharStream(java.io.Reader dstream, int startline, + int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + + /** Constructor. */ + public SimpleCharStream(java.io.Reader dstream) + { + this(dstream, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream, int startline, + int startcolumn, int buffersize) + { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) + { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + } + prevCharIsLF = prevCharIsCR = false; + tokenBegin = inBuf = maxNextCharInd = 0; + bufpos = -1; + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream, int startline, + int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream) + { + ReInit(dstream, 1, 1, 4096); + } + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); + } + + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, startline, startcolumn, 4096); + } + + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream, int startline, + int startcolumn) + { + this(dstream, startline, startcolumn, 4096); + } + + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + this(dstream, encoding, 1, 1, 4096); + } + + /** Constructor. */ + public SimpleCharStream(java.io.InputStream dstream) + { + this(dstream, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) + { + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream) + { + ReInit(dstream, 1, 1, 4096); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException + { + ReInit(dstream, encoding, startline, startcolumn, 4096); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + /** Get token literal value. */ + static public String GetImage() + { + if (bufpos >= tokenBegin) + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + else + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + + /** Get the suffix. */ + static public char[] GetSuffix(int len) + { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + else + { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + /** Reset buffer when finished. */ + static public void Done() + { + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + static public void adjustBeginLineColumn(int newLine, int newCol) + { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) + { + len = bufpos - tokenBegin + inBuf + 1; + } + else + { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; + + while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) + { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) + { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) + { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) + bufline[j] = newLine++; + else + bufline[j] = newLine; + } + } + + line = bufline[j]; + column = bufcolumn[j]; + } + static boolean getTrackLineColumn() { return trackLineColumn; } + static void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; } +} +/* JavaCC - OriginalChecksum=052d2c8783a7a693ccde91d90feb1d3b (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleNode.java b/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleNode.java new file mode 100644 index 0000000..4ee56f2 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/SimpleNode.java @@ -0,0 +1,102 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JJTree: Do not edit this line. SimpleNode.java Version 7.0 */ +/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +public +class SimpleNode implements Node { + + protected Node parent; + protected Node[] children; + protected int id; + protected Object value; + protected CParser parser; + + public SimpleNode(int i) { + id = i; + } + + public SimpleNode(CParser p, int i) { + this(i); + parser = p; + } + + public void jjtOpen() { + } + + public void jjtClose() { + } + + public void jjtSetParent(Node n) { parent = n; } + public Node jjtGetParent() { return parent; } + + public void jjtAddChild(Node n, int i) { + if (children == null) { + children = new Node[i + 1]; + } else if (i >= children.length) { + Node c[] = new Node[i + 1]; + System.arraycopy(children, 0, c, 0, children.length); + children = c; + } + children[i] = n; + } + + public Node jjtGetChild(int i) { + return children[i]; + } + + public int jjtGetNumChildren() { + return (children == null) ? 0 : children.length; + } + + public void jjtSetValue(Object value) { this.value = value; } + public Object jjtGetValue() { return value; } + + /** Accept the visitor. **/ + public Object jjtAccept(CParserVisitor visitor, Object data) +{ + return visitor.visit(this, data); + } + + /** Accept the visitor. **/ + public Object childrenAccept(CParserVisitor visitor, Object data) +{ + if (children != null) { + for (int i = 0; i < children.length; ++i) { + children[i].jjtAccept(visitor, data); + } + } + return data; + } + + /* You can override these two methods in subclasses of SimpleNode to + customize the way the node appears when the tree is dumped. If + your output uses more than one line you should override + toString(String), otherwise overriding toString() is probably all + you need to do. */ + + public String toString() { + return CParserTreeConstants.jjtNodeName[id]; + } + public String toString(String prefix) { return prefix + toString(); } + + /* Override this method if you want to customize how the node dumps + out its children. */ + + public void dump(String prefix) { + System.out.println(toString(prefix)); + if (children != null) { + for (int i = 0; i < children.length; ++i) { + SimpleNode n = (SimpleNode)children[i]; + if (n != null) { + n.dump(prefix + " "); + } + } + } + } + + public int getId() { + return id; + } +} + +/* JavaCC - OriginalChecksum=97592567112e82e2388d067919812e6e (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/Token.java b/src/main/java/ghidrust/decompiler/parser/c/gen/Token.java new file mode 100644 index 0000000..5c22565 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/Token.java @@ -0,0 +1,132 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */ +/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ +/** + * Describes the input token stream. + */ + +public class Token implements java.io.Serializable { + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /** + * An integer that describes the kind of this token. This numbering + * system is determined by JavaCCParser, and a table of these numbers is + * stored in the file ...Constants.java. + */ + public int kind; + + /** The line number of the first character of this Token. */ + public int beginLine; + /** The column number of the first character of this Token. */ + public int beginColumn; + /** The line number of the last character of this Token. */ + public int endLine; + /** The column number of the last character of this Token. */ + public int endColumn; + + /** + * The string image of the token. + */ + public String image; + + /** + * A reference to the next regular (non-special) token from the input + * stream. If this is the last token from the input stream, or if the + * token manager has not read tokens beyond this one, this field is + * set to null. This is true only if this token is also a regular + * token. Otherwise, see below for a description of the contents of + * this field. + */ + public Token next; + + /** + * This field is used to access special tokens that occur prior to this + * token, but after the immediately preceding regular (non-special) token. + * If there are no such special tokens, this field is set to null. + * When there are more than one such special token, this field refers + * to the last of these special tokens, which in turn refers to the next + * previous special token through its specialToken field, and so on + * until the first special token (whose specialToken field is null). + * The next fields of special tokens refer to other special tokens that + * immediately follow it (without an intervening regular token). If there + * is no such token, this field is null. + */ + public Token specialToken; + + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() {} + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) + { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) + { + this.kind = kind; + this.image = image; + } + + /** + * Returns the image. + */ + @Override + public String toString() + { + return image; + } + + /** + * Returns a new Token object, by default. However, if you want, you + * can create and return subclass objects based on the value of ofKind. + * Simply add the cases to the switch for all those special cases. + * For example, if you have a subclass of Token called IDToken that + * you want to create if ofKind is ID, simply add something like : + * + * case MyParserConstants.ID : return new IDToken(ofKind, image); + * + * to the following switch statement. Then you can cast matchedToken + * variable to the appropriate type and use sit in your lexical actions. + */ + public static Token newToken(int ofKind, String image) + { + switch(ofKind) + { + default : return new Token(ofKind, image); + } + } + + public static Token newToken(int ofKind) + { + return newToken(ofKind, null); + } + +} +/* JavaCC - OriginalChecksum=093f73b266edc0ed6a424fcd3b5446d1 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/TokenMgrError.java b/src/main/java/ghidrust/decompiler/parser/c/gen/TokenMgrError.java new file mode 100644 index 0000000..7360e23 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/TokenMgrError.java @@ -0,0 +1,147 @@ +package ghidrust.decompiler.parser.c.gen; + +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */ +/* JavaCCOptions: */ +/** Token Manager Error. */ +public class TokenMgrError extends Error +{ + + /** + * The version identifier for this Serializable class. + * Increment only if the serialized form of the + * class changes. + */ + private static final long serialVersionUID = 1L; + + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ + + /** + * Lexical error occurred. + */ + public static final int LEXICAL_ERROR = 0; + + /** + * An attempt was made to create a second instance of a static token manager. + */ + public static final int STATIC_LEXER_ERROR = 1; + + /** + * Tried to change to an invalid lexical state. + */ + public static final int INVALID_LEXICAL_STATE = 2; + + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + public static final int LOOP_DETECTED = 3; + + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; + + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuilder retval = new StringBuilder(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) + { + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } + } + return retval.toString(); + } + + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) { + char curChar1 = (char)curChar; + return("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } + + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + @Override + public String getMessage() { + return super.getMessage(); + } + + /* + * Constructors of various flavors follow. + */ + + /** No arg constructor. */ + public TokenMgrError() { + } + + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } + + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) { + this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } +} +/* JavaCC - OriginalChecksum=9e201c978d59ab6f122a52837e6310b1 (do not edit this line) */ diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/c.jj b/src/main/java/ghidrust/decompiler/parser/c/gen/c.jj new file mode 100644 index 0000000..45d1a1d --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/c.jj @@ -0,0 +1,1817 @@ +/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. c.jj */ +/*@egen*//* +C grammar and JJTree definition for use with JavaCC +Contributed by Doug South (dsouth@squirrel.com.au) 21/3/97 +From: https://github.com/javacc/javacc/blob/master/grammars/CParser.jj +*/ + +/* The following code has been significantly modified so as to make it compatible with Ghidra's decompiled output +* and for the Rust transpilation +*/ + +options { + + +} + +PARSER_BEGIN(CParser) + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import ghidrust.decompiler.parser.c.CVisitor; + +public class CParser/*@bgen(jjtree)*/implements CParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/ + protected static JJTCParserState jjtree = new JJTCParserState(); + +/*@egen*/ + private static CParser c_parser; + + // Run the parser + public static String transpile(String c_code) { + InputStream stream = new ByteArrayInputStream(c_code.getBytes(StandardCharsets.UTF_8)); + c_parser = new CParser(stream); + + try { + return parse(); + } catch (ParseException e) { + System.out.println("Rust transpiler: Encountered errors during parsing."); + e.printStackTrace(); + return null; + } + } + + public static String parse() throws ParseException { + CParserVisitor visitor = new CVisitor(); + return (String) c_parser.FunctionDefinition().jjtAccept(visitor, null); + } +} + +PARSER_END(CParser) + +SKIP : { + " " + | "\t" + | "\n" + | "\r" + | <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")> + | <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/"> + | "#" : PREPROCESSOR_OUTPUT +} + + SKIP: +{ + "\n" : DEFAULT +} + + MORE: +{ + "\\\n" + | + "\\\r\n" + | + < ~[] > +} + + +TOKEN : { + (["l","L"])? | (["l","L"])? | (["l","L"])?> + | <#DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])*> + | <#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+> + | <#OCTAL_LITERAL: "0" (["0"-"7"])*> + | )? (["f","F","d","D"])? | "." (["0"-"9"])+ ()? (["f","F","d","D"])? | (["0"-"9"])+ (["f","F","d","D"])? | (["0"-"9"])+ ()? ["f","F","d","D"]> + | <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+> + | + | + | )?> // Ghidra specific unknown type +} + +TOKEN : { + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + // code ptr, Ghidra specific +} + +TOKEN : { + ( | )*> + | <#LETTER: ["$","A"-"Z","_","a"-"z"]> + | <#DIGIT: ["0"-"9"]> +} + + +SimpleNode FunctionDefinition() : {/*@bgen(jjtree) FunctionDefinition */ + ASTFunctionDefinition jjtn000 = new ASTFunctionDefinition(JJTFUNCTIONDEFINITION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) FunctionDefinition */ + try { +/*@egen*/ + [LOOKAHEAD(DeclarationSpecifiers()) DeclarationSpecifiers()] Declarator() + CompoundStatement()/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + return jjtn000; + }/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Declaration() : {/*@bgen(jjtree) Declaration */ + ASTDeclaration jjtn000 = new ASTDeclaration(JJTDECLARATION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Declaration */ + try { +/*@egen*/ + DeclarationSpecifiers() [ InitDeclaratorList() ] ";"/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void DeclarationList() : {/*@bgen(jjtree) DeclarationList */ + ASTDeclarationList jjtn000 = new ASTDeclarationList(JJTDECLARATIONLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) DeclarationList */ + try { +/*@egen*/ + ( LOOKAHEAD(Declaration()) Declaration() )+/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void DeclarationSpecifiers() : {/*@bgen(jjtree) DeclarationSpecifiers */ + ASTDeclarationSpecifiers jjtn000 = new ASTDeclarationSpecifiers(JJTDECLARATIONSPECIFIERS); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) DeclarationSpecifiers */ + try { +/*@egen*/ + StorageClassSpecifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ] | + TypeSpecifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ] | + TypeQualifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void StorageClassSpecifier() : +{/*@bgen(jjtree) GhostStringToken */ + ASTGhostStringToken jjtn000 = new ASTGhostStringToken(JJTGHOSTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ + Token t; +} +{/*@bgen(jjtree) GhostStringToken */ + try { +/*@egen*/ + ( t = | t = | t = | t = | t = )/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + jjtn000.setValue(t.image); + }/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void TypeSpecifier() : +{/*@bgen(jjtree) TypeStringToken */ + ASTTypeStringToken jjtn000 = new ASTTypeStringToken(JJTTYPESTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ + Token t; +} +{/*@bgen(jjtree) TypeStringToken */ + try { +/*@egen*/ + ( t = | t = | t = | t = | t = | t = | t = | t = | + t = | t = | t = )/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + jjtn000.setValue(t.image); + }/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void TypeQualifier() : +{/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ + Token t; +} +{/*@bgen(jjtree) StringToken */ + try { +/*@egen*/ + ( t = | t = )/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + jjtn000.setValue(t.image); + }/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void InitDeclaratorList() : {/*@bgen(jjtree) InitDeclaratorList */ + ASTInitDeclaratorList jjtn000 = new ASTInitDeclaratorList(JJTINITDECLARATORLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) InitDeclaratorList */ + try { +/*@egen*/ + InitDeclarator() ("," InitDeclarator())*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void InitDeclarator() : {/*@bgen(jjtree) InitDeclarator */ + ASTInitDeclarator jjtn000 = new ASTInitDeclarator(JJTINITDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) InitDeclarator */ + try { +/*@egen*/ + Declarator() [ "=" Initializer() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void SpecifierQualifierList() : {/*@bgen(jjtree) SpecifierQualifierList */ + ASTSpecifierQualifierList jjtn000 = new ASTSpecifierQualifierList(JJTSPECIFIERQUALIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) SpecifierQualifierList */ + try { +/*@egen*/ + TypeSpecifier() [ LOOKAHEAD(SpecifierQualifierList()) + SpecifierQualifierList() ]| + TypeQualifier() [ LOOKAHEAD(SpecifierQualifierList()) + SpecifierQualifierList() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Declarator() : {/*@bgen(jjtree) Declarator */ + ASTDeclarator jjtn000 = new ASTDeclarator(JJTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Declarator */ + try { +/*@egen*/ + [ Pointer() ] DirectDeclarator()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void DirectDeclarator() : {/*@bgen(jjtree) DirectDeclarator */ + ASTDirectDeclarator jjtn000 = new ASTDirectDeclarator(JJTDIRECTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) DirectDeclarator */ + try { +/*@egen*/ + ( Identifier() | "(" Declarator() ")" ) + ( "[" [ ConstantExpression() ] "]" | + LOOKAHEAD(3) "(" ParameterTypeList() ")" | + "(" [ IdentifierList() ] ")" )*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Pointer() : {/*@bgen(jjtree) Pointer */ + ASTPointer jjtn000 = new ASTPointer(JJTPOINTER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Pointer */ + try { +/*@egen*/ + "*" [ TypeQualifierList() ] [ Pointer() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void TypeQualifierList() : {/*@bgen(jjtree) TypeQualifierList */ + ASTTypeQualifierList jjtn000 = new ASTTypeQualifierList(JJTTYPEQUALIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) TypeQualifierList */ + try { +/*@egen*/ + (TypeQualifier())+/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ParameterTypeList() : {/*@bgen(jjtree) ParameterTypeList */ + ASTParameterTypeList jjtn000 = new ASTParameterTypeList(JJTPARAMETERTYPELIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ParameterTypeList */ + try { +/*@egen*/ + ParameterList() ["," "..." ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ParameterList() : {/*@bgen(jjtree) ParameterList */ + ASTParameterList jjtn000 = new ASTParameterList(JJTPARAMETERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ParameterList */ + try { +/*@egen*/ + ParameterDeclaration() (LOOKAHEAD(2) "," ParameterDeclaration())*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ParameterDeclaration() : {/*@bgen(jjtree) ParameterDeclaration */ + ASTParameterDeclaration jjtn000 = new ASTParameterDeclaration(JJTPARAMETERDECLARATION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ParameterDeclaration */ + try { +/*@egen*/ + DeclarationSpecifiers() ( LOOKAHEAD(Declarator()) Declarator() | [ AbstractDeclarator() ] )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void IdentifierList() : {/*@bgen(jjtree) IdentifierList */ + ASTIdentifierList jjtn000 = new ASTIdentifierList(JJTIDENTIFIERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) IdentifierList */ + try { +/*@egen*/ + Identifier() ("," Identifier())*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Initializer() : {/*@bgen(jjtree) Initializer */ + ASTInitializer jjtn000 = new ASTInitializer(JJTINITIALIZER); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Initializer */ + try { +/*@egen*/ + ( AssignmentExpression() | + "{" InitializerList() [","] "}" )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void InitializerList() : {/*@bgen(jjtree) InitializerList */ + ASTInitializerList jjtn000 = new ASTInitializerList(JJTINITIALIZERLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) InitializerList */ + try { +/*@egen*/ + Initializer() (LOOKAHEAD(2) "," Initializer())*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void TypeName() : {/*@bgen(jjtree) TypeName */ + ASTTypeName jjtn000 = new ASTTypeName(JJTTYPENAME); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) TypeName */ + try { +/*@egen*/ + SpecifierQualifierList() [ AbstractDeclarator() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ + +} + +void AbstractDeclarator() : {/*@bgen(jjtree) AbstractDeclarator */ + ASTAbstractDeclarator jjtn000 = new ASTAbstractDeclarator(JJTABSTRACTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AbstractDeclarator */ + try { +/*@egen*/ + ( LOOKAHEAD(3) Pointer() | + [Pointer()] DirectAbstractDeclarator() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void DirectAbstractDeclarator() : {/*@bgen(jjtree) DirectAbstractDeclarator */ + ASTDirectAbstractDeclarator jjtn000 = new ASTDirectAbstractDeclarator(JJTDIRECTABSTRACTDECLARATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) DirectAbstractDeclarator */ + try { +/*@egen*/ + ( LOOKAHEAD(2) "(" AbstractDeclarator() ")" | + "[" [ConstantExpression()] "]" | + "(" [ParameterTypeList()] ")" ) + + ( "[" [ ConstantExpression() ] "]" | "(" [ ParameterTypeList() ] ")" )*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Statement() : {/*@bgen(jjtree) Statement */ + ASTStatement jjtn000 = new ASTStatement(JJTSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Statement */ + try { +/*@egen*/ + ( LOOKAHEAD(2) LabeledStatement() | + ExpressionStatement() | + CompoundStatement() | + SelectionStatement() | + IterationStatement() | + JumpStatement() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void LabeledStatement() : {/*@bgen(jjtree) LabeledStatement */ + ASTLabeledStatement jjtn000 = new ASTLabeledStatement(JJTLABELEDSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) LabeledStatement */ + try { +/*@egen*/ + ( Identifier() ":" Statement() | + ConstantExpression() ":" Statement() | + ":" Statement() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ExpressionStatement() : {/*@bgen(jjtree) ExpressionStatement */ + ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ExpressionStatement */ + try { +/*@egen*/ + [ Expression() ] ";"/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void CompoundStatement() : {/*@bgen(jjtree) CompoundStatement */ + ASTCompoundStatement jjtn000 = new ASTCompoundStatement(JJTCOMPOUNDSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) CompoundStatement */ + try { +/*@egen*/ + "{" [ LOOKAHEAD(DeclarationList()) DeclarationList() ] + [ StatementList() ] + "}"/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void StatementList() : {/*@bgen(jjtree) StatementList */ + ASTStatementList jjtn000 = new ASTStatementList(JJTSTATEMENTLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) StatementList */ + try { +/*@egen*/ + (Statement())+/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void SelectionStatement() : {/*@bgen(jjtree) SelectionStatement */ + ASTSelectionStatement jjtn000 = new ASTSelectionStatement(JJTSELECTIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) SelectionStatement */ + try { +/*@egen*/ + ( "(" Expression() ")" Statement() [ LOOKAHEAD(2) Statement() ] | + "(" Expression() ")" Statement() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void IterationStatement() : {/*@bgen(jjtree) IterationStatement */ + ASTIterationStatement jjtn000 = new ASTIterationStatement(JJTITERATIONSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) IterationStatement */ + try { +/*@egen*/ + ( "(" Expression() ")" Statement() | + Statement() "(" Expression() ")" ";" | + "(" [ Expression() ] ";" [ Expression() ] ";" [ Expression() ] ")" Statement() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void JumpStatement() : {/*@bgen(jjtree) JumpStatement */ + ASTJumpStatement jjtn000 = new ASTJumpStatement(JJTJUMPSTATEMENT); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) JumpStatement */ + try { +/*@egen*/ + ( Identifier() ";" | + ";" | + ";" | + [ Expression() ] ";" )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Expression() : {/*@bgen(jjtree) Expression */ + ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) Expression */ + try { +/*@egen*/ + AssignmentExpression() ( "," AssignmentExpression() )* | DeclarationSpecifiers() InitDeclaratorList()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void AssignmentExpression() : {/*@bgen(jjtree) AssignmentExpression */ + ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AssignmentExpression */ + try { +/*@egen*/ + LOOKAHEAD(UnaryExpression() AssignmentOperator()) UnaryExpression() AssignmentOperator() AssignmentExpression() | + LOOKAHEAD(3) ConditionalExpression()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void AssignmentOperator() : {/*@bgen(jjtree) AssignmentOperator */ + ASTAssignmentOperator jjtn000 = new ASTAssignmentOperator(JJTASSIGNMENTOPERATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AssignmentOperator */ + try { +/*@egen*/ + ( "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | "&=" | "^=" | "|=" )/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ConditionalExpression() : {/*@bgen(jjtree) ConditionalExpression */ + ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ConditionalExpression */ + try { +/*@egen*/ + LogicalORExpression() [ "?" Expression() ":" ConditionalExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ConstantExpression() : {/*@bgen(jjtree) ConstantExpression */ + ASTConstantExpression jjtn000 = new ASTConstantExpression(JJTCONSTANTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ConstantExpression */ + try { +/*@egen*/ + ConditionalExpression()/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void LogicalORExpression() : {/*@bgen(jjtree) LogicalORExpression */ + ASTLogicalORExpression jjtn000 = new ASTLogicalORExpression(JJTLOGICALOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) LogicalORExpression */ + try { +/*@egen*/ + LogicalANDExpression() [ "||" LogicalORExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void LogicalANDExpression() : {/*@bgen(jjtree) LogicalANDExpression */ + ASTLogicalANDExpression jjtn000 = new ASTLogicalANDExpression(JJTLOGICALANDEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) LogicalANDExpression */ + try { +/*@egen*/ + InclusiveORExpression() [ "&&" LogicalANDExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void InclusiveORExpression() : {/*@bgen(jjtree) InclusiveORExpression */ + ASTInclusiveORExpression jjtn000 = new ASTInclusiveORExpression(JJTINCLUSIVEOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) InclusiveORExpression */ + try { +/*@egen*/ + ExclusiveORExpression() [ "|" InclusiveORExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ExclusiveORExpression() : {/*@bgen(jjtree) ExclusiveORExpression */ + ASTExclusiveORExpression jjtn000 = new ASTExclusiveORExpression(JJTEXCLUSIVEOREXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ExclusiveORExpression */ + try { +/*@egen*/ + ANDExpression() [ "^" ExclusiveORExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ANDExpression() : {/*@bgen(jjtree) ANDExpression */ + ASTANDExpression jjtn000 = new ASTANDExpression(JJTANDEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ANDExpression */ + try { +/*@egen*/ + EqualityExpression() [ "&" ANDExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void EqualityExpression() : {/*@bgen(jjtree) EqualityExpression */ + ASTEqualityExpression jjtn000 = new ASTEqualityExpression(JJTEQUALITYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) EqualityExpression */ + try { +/*@egen*/ + RelationalExpression() [ ( "==" | "!=" ) EqualityExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void RelationalExpression() : {/*@bgen(jjtree) RelationalExpression */ + ASTRelationalExpression jjtn000 = new ASTRelationalExpression(JJTRELATIONALEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) RelationalExpression */ + try { +/*@egen*/ + ShiftExpression() [ ( "<" | ">" | "<=" | ">=" ) RelationalExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ShiftExpression() : {/*@bgen(jjtree) ShiftExpression */ + ASTShiftExpression jjtn000 = new ASTShiftExpression(JJTSHIFTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ShiftExpression */ + try { +/*@egen*/ + AdditiveExpression() [ ( "<<" | ">>" ) ShiftExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void AdditiveExpression() : {/*@bgen(jjtree) AdditiveExpression */ + ASTAdditiveExpression jjtn000 = new ASTAdditiveExpression(JJTADDITIVEEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) AdditiveExpression */ + try { +/*@egen*/ + MultiplicativeExpression() [ ( "+" | "-" ) AdditiveExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void MultiplicativeExpression() : {/*@bgen(jjtree) MultiplicativeExpression */ + ASTMultiplicativeExpression jjtn000 = new ASTMultiplicativeExpression(JJTMULTIPLICATIVEEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) MultiplicativeExpression */ + try { +/*@egen*/ + CastExpression() [ ( "*" | "/" | "%" ) MultiplicativeExpression() ]/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void CastExpression() : {/*@bgen(jjtree) CastExpression */ + ASTCastExpression jjtn000 = new ASTCastExpression(JJTCASTEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) CastExpression */ + try { +/*@egen*/ + ( LOOKAHEAD("(" TypeName() ")" CastExpression() ) "(" TypeName() ")" CastExpression() | + UnaryExpression() )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void UnaryExpression() : {/*@bgen(jjtree) UnaryExpression */ + ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) UnaryExpression */ + try { +/*@egen*/ + ( LOOKAHEAD(3) PostfixExpression() | + "++" UnaryExpression() | + "--" UnaryExpression() | + UnaryOperator() CastExpression() | + ( LOOKAHEAD(UnaryExpression() ) UnaryExpression() | "(" TypeName() ")" ) )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void UnaryOperator() : {/*@bgen(jjtree) UnaryOperator */ + ASTUnaryOperator jjtn000 = new ASTUnaryOperator(JJTUNARYOPERATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) UnaryOperator */ + try { +/*@egen*/ + ( "&" | "*" | "+" | "-" | "~" | "!" )/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void PostfixExpression() : {/*@bgen(jjtree) PostfixExpression */ + ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) PostfixExpression */ + try { +/*@egen*/ + PrimaryExpression() ( "[" Expression() "]" | + "(" [ LOOKAHEAD(ArgumentExpressionList() ) ArgumentExpressionList() ] ")" | + "." Identifier() | + "->" Identifier() | + "++" | + "--" )*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void PrimaryExpression() : {/*@bgen(jjtree) PrimaryExpression */ + ASTPrimaryExpression jjtn000 = new ASTPrimaryExpression(JJTPRIMARYEXPRESSION); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) PrimaryExpression */ + try { +/*@egen*/ + ( Identifier() | + Constant() | + "(" Expression() ")" )/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void ArgumentExpressionList() : {/*@bgen(jjtree) ArgumentExpressionList */ + ASTArgumentExpressionList jjtn000 = new ASTArgumentExpressionList(JJTARGUMENTEXPRESSIONLIST); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/} +{/*@bgen(jjtree) ArgumentExpressionList */ + try { +/*@egen*/ + AssignmentExpression() ( "," AssignmentExpression() )*/*@bgen(jjtree)*/ + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + throw (RuntimeException)jjte000; + } + if (jjte000 instanceof ParseException) { + throw (ParseException)jjte000; + } + throw (Error)jjte000; + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Identifier() : +{/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ + Token t; +} +{/*@bgen(jjtree) StringToken */ + try { +/*@egen*/ + t = /*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + jjtn000.setValue(t.image); + }/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + +void Constant() : +{/*@bgen(jjtree) StringToken */ + ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ + Token t; +} +{/*@bgen(jjtree) StringToken */ + try { +/*@egen*/ + (t = | t = | t = | t = )/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ + { + jjtn000.setValue(t.image); + }/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} \ No newline at end of file diff --git a/src/main/java/ghidrust/decompiler/parser/c/gen/c.jjt b/src/main/java/ghidrust/decompiler/parser/c/gen/c.jjt new file mode 100644 index 0000000..fdd4965 --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/c/gen/c.jjt @@ -0,0 +1,477 @@ +/* +C grammar and JJTree definition for use with JavaCC +Contributed by Doug South (dsouth@squirrel.com.au) 21/3/97 +From: https://github.com/javacc/javacc/blob/master/grammars/CParser.jj +*/ + +/* The following code has been significantly modified so as to make it compatible with Ghidra's decompiled output +* and for the Rust transpilation +*/ + +options { + MULTI = true; + VISITOR = true; +} + +PARSER_BEGIN(CParser) + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import ghidrust.decompiler.parser.c.CVisitor; + +public class CParser { + private static CParser c_parser; + + // Run the parser + public static String transpile(String c_code) { + InputStream stream = new ByteArrayInputStream(c_code.getBytes(StandardCharsets.UTF_8)); + c_parser = new CParser(stream); + + try { + return parse(); + } catch (ParseException e) { + System.out.println("Rust transpiler: Encountered errors during parsing."); + e.printStackTrace(); + return null; + } + } + + public static String parse() throws ParseException { + CParserVisitor visitor = new CVisitor(); + return (String) c_parser.FunctionDefinition().jjtAccept(visitor, null); + } +} + +PARSER_END(CParser) + +SKIP : { + " " + | "\t" + | "\n" + | "\r" + | <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")> + | <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/"> + | "#" : PREPROCESSOR_OUTPUT +} + + SKIP: +{ + "\n" : DEFAULT +} + + MORE: +{ + "\\\n" + | + "\\\r\n" + | + < ~[] > +} + + +TOKEN : { + (["l","L"])? | (["l","L"])? | (["l","L"])?> + | <#DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])*> + | <#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+> + | <#OCTAL_LITERAL: "0" (["0"-"7"])*> + | )? (["f","F","d","D"])? | "." (["0"-"9"])+ ()? (["f","F","d","D"])? | (["0"-"9"])+ (["f","F","d","D"])? | (["0"-"9"])+ ()? ["f","F","d","D"]> + | <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+> + | + | + | )?> // Ghidra specific unknown type +} + +TOKEN : { + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + | + // code ptr, Ghidra specific +} + +TOKEN : { + ( | )*> + | <#LETTER: ["$","A"-"Z","_","a"-"z"]> + | <#DIGIT: ["0"-"9"]> +} + + +SimpleNode FunctionDefinition() : {} +{ + [LOOKAHEAD(DeclarationSpecifiers()) DeclarationSpecifiers()] Declarator() + CompoundStatement() + { + return jjtThis; + } +} + +void Declaration() : {} +{ + DeclarationSpecifiers() [ InitDeclaratorList() ] ";" +} + +void DeclarationList() : {} +{ + ( LOOKAHEAD(Declaration()) Declaration() )+ +} + +void DeclarationSpecifiers() : {} +{ + StorageClassSpecifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ] | + TypeSpecifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ] | + TypeQualifier() [ LOOKAHEAD(DeclarationSpecifiers()) + DeclarationSpecifiers() ] +} + +void StorageClassSpecifier() #GhostStringToken : +{ + Token t; +} +{ + ( t = | t = | t = | t = | t = ) + { + jjtThis.setValue(t.image); + } +} + +void TypeSpecifier() #TypeStringToken : +{ + Token t; +} +{ + ( t = | t = | t = | t = | t = | t = | t = | t = | + t = | t = | t = ) + { + jjtThis.setValue(t.image); + } +} + +void TypeQualifier() #StringToken : +{ + Token t; +} +{ + ( t = | t = ) + { + jjtThis.setValue(t.image); + } +} + +void InitDeclaratorList() : {} +{ + InitDeclarator() ("," InitDeclarator())* +} + +void InitDeclarator() : {} +{ + Declarator() [ "=" Initializer() ] +} + +void SpecifierQualifierList() : {} +{ + TypeSpecifier() [ LOOKAHEAD(SpecifierQualifierList()) + SpecifierQualifierList() ]| + TypeQualifier() [ LOOKAHEAD(SpecifierQualifierList()) + SpecifierQualifierList() ] +} + +void Declarator() : {} +{ + [ Pointer() ] DirectDeclarator() +} + +void DirectDeclarator() : {} +{ + ( Identifier() | "(" Declarator() ")" ) + ( "[" [ ConstantExpression() ] "]" | + LOOKAHEAD(3) "(" ParameterTypeList() ")" | + "(" [ IdentifierList() ] ")" )* +} + +void Pointer() : {} +{ + "*" [ TypeQualifierList() ] [ Pointer() ] +} + +void TypeQualifierList() : {} +{ + (TypeQualifier())+ +} + +void ParameterTypeList() : {} +{ + ParameterList() ["," "..." ] +} + +void ParameterList() : {} +{ + ParameterDeclaration() (LOOKAHEAD(2) "," ParameterDeclaration())* +} + +void ParameterDeclaration() : {} +{ + DeclarationSpecifiers() ( LOOKAHEAD(Declarator()) Declarator() | [ AbstractDeclarator() ] ) +} + +void IdentifierList() : {} +{ + Identifier() ("," Identifier())* +} + +void Initializer() : {} +{ + ( AssignmentExpression() | + "{" InitializerList() [","] "}" ) +} + +void InitializerList() : {} +{ + Initializer() (LOOKAHEAD(2) "," Initializer())* +} + +void TypeName() : {} +{ + SpecifierQualifierList() [ AbstractDeclarator() ] + +} + +void AbstractDeclarator() : {} +{ + ( LOOKAHEAD(3) Pointer() | + [Pointer()] DirectAbstractDeclarator() ) +} + +void DirectAbstractDeclarator() : {} +{ + ( LOOKAHEAD(2) "(" AbstractDeclarator() ")" | + "[" [ConstantExpression()] "]" | + "(" [ParameterTypeList()] ")" ) + + ( "[" [ ConstantExpression() ] "]" | "(" [ ParameterTypeList() ] ")" )* +} + +void Statement() : {} +{ + ( LOOKAHEAD(2) LabeledStatement() | + ExpressionStatement() | + CompoundStatement() | + SelectionStatement() | + IterationStatement() | + JumpStatement() ) +} + +void LabeledStatement() : {} +{ + ( Identifier() ":" Statement() | + ConstantExpression() ":" Statement() | + ":" Statement() ) +} + +void ExpressionStatement() : {} +{ + [ Expression() ] ";" +} + +void CompoundStatement() : {} +{ + "{" [ LOOKAHEAD(DeclarationList()) DeclarationList() ] + [ StatementList() ] + "}" +} + +void StatementList() : {} +{ + (Statement())+ +} + +void SelectionStatement() : {} +{ + ( "(" Expression() ")" Statement() [ LOOKAHEAD(2) Statement() ] | + "(" Expression() ")" Statement() ) +} + +void IterationStatement() : {} +{ + ( "(" Expression() ")" Statement() | + Statement() "(" Expression() ")" ";" | + "(" [ Expression() ] ";" [ Expression() ] ";" [ Expression() ] ")" Statement() ) +} + +void JumpStatement() : {} +{ + ( Identifier() ";" | + ";" | + ";" | + [ Expression() ] ";" ) +} + +void Expression() : {} +{ + AssignmentExpression() ( "," AssignmentExpression() )* | DeclarationSpecifiers() InitDeclaratorList() +} + +void AssignmentExpression() : {} +{ + LOOKAHEAD(UnaryExpression() AssignmentOperator()) UnaryExpression() AssignmentOperator() AssignmentExpression() | + LOOKAHEAD(3) ConditionalExpression() +} + +void AssignmentOperator() : {} +{ + ( "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | "&=" | "^=" | "|=" ) +} + +void ConditionalExpression() : {} +{ + LogicalORExpression() [ "?" Expression() ":" ConditionalExpression() ] +} + +void ConstantExpression() : {} +{ + ConditionalExpression() +} + +void LogicalORExpression() : {} +{ + LogicalANDExpression() [ "||" LogicalORExpression() ] +} + +void LogicalANDExpression() : {} +{ + InclusiveORExpression() [ "&&" LogicalANDExpression() ] +} + +void InclusiveORExpression() : {} +{ + ExclusiveORExpression() [ "|" InclusiveORExpression() ] +} + +void ExclusiveORExpression() : {} +{ + ANDExpression() [ "^" ExclusiveORExpression() ] +} + +void ANDExpression() : {} +{ + EqualityExpression() [ "&" ANDExpression() ] +} + +void EqualityExpression() : {} +{ + RelationalExpression() [ ( "==" | "!=" ) EqualityExpression() ] +} + +void RelationalExpression() : {} +{ + ShiftExpression() [ ( "<" | ">" | "<=" | ">=" ) RelationalExpression() ] +} + +void ShiftExpression() : {} +{ + AdditiveExpression() [ ( "<<" | ">>" ) ShiftExpression() ] +} + +void AdditiveExpression() : {} +{ + MultiplicativeExpression() [ ( "+" | "-" ) AdditiveExpression() ] +} + +void MultiplicativeExpression() : {} +{ + CastExpression() [ ( "*" | "/" | "%" ) MultiplicativeExpression() ] +} + +void CastExpression() : {} +{ + ( LOOKAHEAD("(" TypeName() ")" CastExpression() ) "(" TypeName() ")" CastExpression() | + UnaryExpression() ) +} + +void UnaryExpression() : {} +{ + ( LOOKAHEAD(3) PostfixExpression() | + "++" UnaryExpression() | + "--" UnaryExpression() | + UnaryOperator() CastExpression() | + ( LOOKAHEAD(UnaryExpression() ) UnaryExpression() | "(" TypeName() ")" ) ) +} + +void UnaryOperator() : {} +{ + ( "&" | "*" | "+" | "-" | "~" | "!" ) +} + +void PostfixExpression() : {} +{ + PrimaryExpression() ( "[" Expression() "]" | + "(" [ LOOKAHEAD(ArgumentExpressionList() ) ArgumentExpressionList() ] ")" | + "." Identifier() | + "->" Identifier() | + "++" | + "--" )* +} + +void PrimaryExpression() : {} +{ + ( Identifier() | + Constant() | + "(" Expression() ")" ) +} + +void ArgumentExpressionList() : {} +{ + AssignmentExpression() ( "," AssignmentExpression() )* +} + +void Identifier() #StringToken : +{ + Token t; +} +{ + t = + { + jjtThis.setValue(t.image); + } +} + +void Constant() #StringToken : +{ + Token t; +} +{ + (t = | t = | t = | t = ) + { + jjtThis.setValue(t.image); + } +} diff --git a/src/main/java/ghidrust/decompiler/parser/generate.sh b/src/main/java/ghidrust/decompiler/parser/generate.sh new file mode 100755 index 0000000..619c25b --- /dev/null +++ b/src/main/java/ghidrust/decompiler/parser/generate.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Shell script to generate the parsers and add the package statement to the top of each file + +cd c/gen + +for file in AST*Token.java; do + mv -- "$file" "${file%.java}.bak" +done + +rm -f *.java c.jj + +jjtree c.jjt +javacc c.jj + +sleep 1 + +for file in *.java; do + sed -i '1s/^/package ghidrust.decompiler.parser.c.gen;\n\n/' $file +done + +for file in AST*Token.bak; do + mv -- "$file" "${file%.bak}.java" +done