public boolean visit(ForStatement s) throws Exception { Map<String, String> parameters = createInitialParameters(s); xmlWriter.startTag("ForStatement", parameters); xmlWriter.startTag("Initializations", new HashMap<String, String>()); for (Expression initialization : s.getInitializations()) { initialization.traverse(this); } xmlWriter.endTag("Initializations"); xmlWriter.startTag("Conditions", new HashMap<String, String>()); for (Expression condition : s.getConditions()) { condition.traverse(this); } xmlWriter.endTag("Conditions"); xmlWriter.startTag("Increasements", new HashMap<String, String>()); for (Expression increasement : s.getIncreasements()) { increasement.traverse(this); } xmlWriter.endTag("Increasements"); s.getAction().traverse(this); return false; }
public boolean visit(LambdaFunctionDeclaration s) throws Exception { Map<String, String> parameters = createInitialParameters(s); parameters.put("isReference", Boolean.toString(s.isReference())); if (s.isStatic()) { parameters.put("isStatic", Boolean.toString(s.isStatic())); } xmlWriter.startTag("LambdaFunctionDeclaration", parameters); xmlWriter.startTag("Arguments", new HashMap<String, String>()); for (FormalParameter p : s.getArguments()) { p.traverse(this); } xmlWriter.endTag("Arguments"); Collection<? extends Expression> lexicalVars = s.getLexicalVars(); if (lexicalVars != null) { xmlWriter.startTag("LexicalVars", new HashMap<String, String>()); for (Expression var : lexicalVars) { var.traverse(this); } xmlWriter.endTag("LexicalVars"); } s.getBody().traverse(this); return false; }
public boolean visit(FullyQualifiedTraitMethodReference s) throws Exception { Map<String, String> parameters = createInitialParameters(s); parameters.put("functionName", s.getFunctionName()); xmlWriter.startTag("FullyQualifiedTraitMethodReference", parameters); xmlWriter.startTag("className", EMPTY_MAP); s.getClassName().traverse(this); xmlWriter.endTag("className"); xmlWriter.endTag("FullyQualifiedTraitMethodReference"); return false; }
public boolean endvisit(ModuleDeclaration s) throws Exception { List<ASTError> errors = ((PHPModuleDeclaration) s).getErrors(); if (!errors.isEmpty()) { xmlWriter.startTag("Errors", null); for (ASTError error : errors) { error.traverse(this); } xmlWriter.endTag("Errors"); } xmlWriter.endTag("ModuleDeclaration"); return true; }
public boolean visit(UseStatement s) throws Exception { Map<String, String> parameters = createInitialParameters(s); xmlWriter.startTag("UseStatement", parameters); xmlWriter.startTag("Parts", new HashMap<String, String>()); for (UsePart p : s.getParts()) { p.traverse(this); } xmlWriter.endTag("Parts"); xmlWriter.endTag("UseStatement"); return false; }
public boolean visit(UsePart s) throws Exception { Map<String, String> parameters = createInitialParameters(s); xmlWriter.startTag("UsePart", parameters); s.getNamespace().traverse(this); if (s.getAlias() != null) { s.getAlias().traverse(this); } xmlWriter.endTag("UsePart"); return false; }
public boolean visit(IfStatement s) throws Exception { Map<String, String> parameters = createInitialParameters(s); xmlWriter.startTag("IfStatement", parameters); xmlWriter.startTag("Condition", new HashMap<String, String>()); s.getCondition().traverse(this); xmlWriter.endTag("Condition"); xmlWriter.startTag("TrueStatement", new HashMap<String, String>()); s.getTrueStatement().traverse(this); xmlWriter.endTag("TrueStatement"); Statement falseStatement = s.getFalseStatement(); if (falseStatement != null) { xmlWriter.startTag("FalseStatement", new HashMap<String, String>()); falseStatement.traverse(this); xmlWriter.endTag("FalseStatement"); } return false; }
public boolean visit(ConditionalExpression s) throws Exception { Map<String, String> parameters = createInitialParameters(s); xmlWriter.startTag("ConditionalExpression", parameters); xmlWriter.startTag("Condition", new HashMap<String, String>()); s.getCondition().traverse(this); xmlWriter.endTag("Condition"); Expression ifTrue = s.getIfTrue(); if (ifTrue != null) { xmlWriter.startTag("IfTrue", new HashMap<String, String>()); ifTrue.traverse(this); xmlWriter.endTag("IfTrue"); } Expression falseExp = s.getIfFalse(); if (falseExp != null) { xmlWriter.startTag("IfFalse", new HashMap<String, String>()); falseExp.traverse(this); xmlWriter.endTag("IfFalse"); } return false; }
public boolean endvisit(GotoStatement s) throws Exception { xmlWriter.endTag("GotoStatement"); return true; }
public boolean endvisit(NamespaceDeclaration s) throws Exception { xmlWriter.endTag("NamespaceDeclaration"); return true; }
public boolean endvisit(GotoLabel s) throws Exception { xmlWriter.endTag("GotoLabel"); return true; }
public boolean endvisit(VariableReference s) throws Exception { xmlWriter.endTag("VariableReference"); return true; }
public boolean endvisit(ListVariable s) throws Exception { xmlWriter.endTag("ListVariable"); return true; }
public boolean endvisit(Quote s) throws Exception { xmlWriter.endTag("Quote"); return true; }
public boolean endvisit(PHPMethodDeclaration s) throws Exception { xmlWriter.endTag("PHPMethodDeclaration"); return true; }
public boolean endvisit(PHPCallArgumentsList s) throws Exception { xmlWriter.endTag("PHPCallArgumentsList"); return true; }
public boolean endvisit(InstanceOfExpression s) throws Exception { xmlWriter.endTag("InstanceOfExpression"); return true; }
public boolean endvisit(StaticFieldAccess s) throws Exception { xmlWriter.endTag("StaticFieldAccess"); return true; }
public boolean endvisit(StaticMethodInvocation s) throws Exception { xmlWriter.endTag("StaticMethodInvocation"); return true; }
public boolean endvisit(StaticDispatch s) throws Exception { xmlWriter.endTag("StaticDispatch"); return true; }
public boolean endvisit(Scalar s) throws Exception { xmlWriter.endTag("Scalar"); return true; }
public boolean endvisit(ReflectionCallExpression s) throws Exception { xmlWriter.endTag("ReflectionCallExpression"); return true; }
public boolean endvisit(LambdaFunctionDeclaration s) throws Exception { xmlWriter.endTag("LambdaFunctionDeclaration"); return true; }
public boolean endvisit(Include s) throws Exception { xmlWriter.endTag("Include"); return true; }
public boolean endvisit(FullyQualifiedReference s) throws Exception { xmlWriter.endTag("FullyQualifiedReference"); return true; }
public boolean endvisit(PrefixExpression s) throws Exception { xmlWriter.endTag("PrefixExpression"); return true; }
public boolean endvisit(NamespaceReference s) throws Exception { xmlWriter.endTag("NamespaceReference"); return true; }
public boolean endvisit(UnaryOperation s) throws Exception { xmlWriter.endTag("UnaryOperation"); return true; }
public boolean endvisit(SwitchCase s) throws Exception { xmlWriter.endTag("SwitchCase"); return true; }
public boolean endvisit(PHPDocTag s) throws Exception { xmlWriter.endTag("PHPDocTag"); return true; }