public void visitVariableExpression(VariableExpression expression) { assertValidIdentifier(expression.getName(), "variable name", expression); super.visitVariableExpression(expression); }
return; } else { s.visit(new VerifierCodeVisitor(this));
protected void assertValidName(String name) { VerifierCodeVisitor.assertValidIdentifier(name, "variable name", new ASTNode()); }
public void visitMethod(MethodNode node) { //GROOVY-3712 - if it's an MOP method, it's an error as they aren't supposed to exist before ACG is invoked if (MopWriter.isMopMethod(node.getName())) { throw new RuntimeParserException("Found unexpected MOP methods in the class node for " + classNode.getName() + "(" + node.getName() + ")", classNode); } this.methodNode = node; adjustTypesIfStaticMainMethod(node); addReturnIfNeeded(node); Statement statement; statement = node.getCode(); if (statement != null) statement.visit(new VerifierCodeVisitor(this)); }
public void visitForLoop(ForStatement expression) { assertValidIdentifier(expression.getVariable().getName(), "for loop variable name", expression); super.visitForLoop(expression); }
return; } else { s.visit(new VerifierCodeVisitor(this));
protected void assertInvalidName(String name) { try { VerifierCodeVisitor.assertValidIdentifier(name, "variable name", new ASTNode()); fail("Should have thrown exception due to invalid name: " + name); } catch (RuntimeParserException e) { System.out.println("Caught invalid exception: " + e); } } }
s.visit(new VerifierCodeVisitor(this)); } else { return;
public void visitFieldExpression(FieldExpression expression) { if (!expression.getField().isSynthetic()) { assertValidIdentifier(expression.getFieldName(), "field name", expression); } super.visitFieldExpression(expression); }
public void visitMethod(MethodNode node) { this.methodNode = node; addReturnIfNeeded(node); Statement statement; if (node.getName().equals("main") && node.isStatic()) { Parameter[] params = node.getParameters(); if (params.length == 1) { Parameter param = params[0]; if (param.getType() == null || param.getType()==ClassHelper.OBJECT_TYPE) { param.setType(ClassHelper.STRING_TYPE.makeArray()); } } } statement = node.getCode(); if (statement!=null) statement.visit(new VerifierCodeVisitor(this)); }
public void visitVariableExpression(VariableExpression expression) { assertValidIdentifier(expression.getName(), "variable name", expression); super.visitVariableExpression(expression); }
public void visitMethod(MethodNode node) { //GROOVY-3712 - if it's an MOP method, it's an error as they aren't supposed to exist before ACG is invoked if(AsmClassGenerator.isMopMethod(node.getName())) { throw new RuntimeParserException("Found unexpected MOP methods in the class node for " + classNode.getName() + "(" + node.getName() + ")", classNode); } this.methodNode = node; adjustTypesIfStaticMainMethod(node); addReturnIfNeeded(node); Statement statement = node.getCode(); if (statement!=null) statement.visit(new VerifierCodeVisitor(this)); }
public void visitVariableExpression(VariableExpression expression) { assertValidIdentifier(expression.getName(), "variable name", expression); super.visitVariableExpression(expression); }
public void visitMethod(MethodNode node) { //GROOVY-3712 - if it's an MOP method, it's an error as they aren't supposed to exist before ACG is invoked if(MopWriter.isMopMethod(node.getName())) { throw new RuntimeParserException("Found unexpected MOP methods in the class node for " + classNode.getName() + "(" + node.getName() + ")", classNode); } this.methodNode = node; adjustTypesIfStaticMainMethod(node); addReturnIfNeeded(node); Statement statement; statement = node.getCode(); if (statement != null) statement.visit(new VerifierCodeVisitor(this)); }
public void visitVariableExpression(VariableExpression expression) { assertValidIdentifier(expression.getName(), "variable name", expression); super.visitVariableExpression(expression); }
if (statement!=null) statement.visit(new VerifierCodeVisitor(this));
public void visitVariableExpression(VariableExpression expression) { assertValidIdentifier(expression.getName(), "variable name", expression); super.visitVariableExpression(expression); }
public void visitForLoop(ForStatement expression) { assertValidIdentifier(expression.getVariable().getName(), "for loop variable name", expression); super.visitForLoop(expression); }
public void visitForLoop(ForStatement expression) { assertValidIdentifier(expression.getVariable().getName(), "for loop variable name", expression); super.visitForLoop(expression); }
public void visitForLoop(ForStatement expression) { assertValidIdentifier(expression.getVariable().getName(), "for loop variable name", expression); super.visitForLoop(expression); }