Пример #1
0
  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;
  }
Пример #2
0
  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;
  }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }
Пример #5
0
  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;
  }
Пример #6
0
 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;
 }
Пример #7
0
  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;
  }
Пример #8
0
  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;
  }
Пример #9
0
 public boolean endvisit(GotoStatement s) throws Exception {
   xmlWriter.endTag("GotoStatement");
   return true;
 }
Пример #10
0
 public boolean endvisit(NamespaceDeclaration s) throws Exception {
   xmlWriter.endTag("NamespaceDeclaration");
   return true;
 }
Пример #11
0
 public boolean endvisit(GotoLabel s) throws Exception {
   xmlWriter.endTag("GotoLabel");
   return true;
 }
Пример #12
0
 public boolean endvisit(VariableReference s) throws Exception {
   xmlWriter.endTag("VariableReference");
   return true;
 }
Пример #13
0
 public boolean endvisit(ListVariable s) throws Exception {
   xmlWriter.endTag("ListVariable");
   return true;
 }
Пример #14
0
 public boolean endvisit(Quote s) throws Exception {
   xmlWriter.endTag("Quote");
   return true;
 }
Пример #15
0
 public boolean endvisit(PHPMethodDeclaration s) throws Exception {
   xmlWriter.endTag("PHPMethodDeclaration");
   return true;
 }
Пример #16
0
 public boolean endvisit(PHPCallArgumentsList s) throws Exception {
   xmlWriter.endTag("PHPCallArgumentsList");
   return true;
 }
Пример #17
0
 public boolean endvisit(InstanceOfExpression s) throws Exception {
   xmlWriter.endTag("InstanceOfExpression");
   return true;
 }
Пример #18
0
 public boolean endvisit(StaticFieldAccess s) throws Exception {
   xmlWriter.endTag("StaticFieldAccess");
   return true;
 }
Пример #19
0
 public boolean endvisit(StaticMethodInvocation s) throws Exception {
   xmlWriter.endTag("StaticMethodInvocation");
   return true;
 }
Пример #20
0
 public boolean endvisit(StaticDispatch s) throws Exception {
   xmlWriter.endTag("StaticDispatch");
   return true;
 }
Пример #21
0
 public boolean endvisit(Scalar s) throws Exception {
   xmlWriter.endTag("Scalar");
   return true;
 }
Пример #22
0
 public boolean endvisit(ReflectionCallExpression s) throws Exception {
   xmlWriter.endTag("ReflectionCallExpression");
   return true;
 }
Пример #23
0
 public boolean endvisit(LambdaFunctionDeclaration s) throws Exception {
   xmlWriter.endTag("LambdaFunctionDeclaration");
   return true;
 }
Пример #24
0
 public boolean endvisit(Include s) throws Exception {
   xmlWriter.endTag("Include");
   return true;
 }
Пример #25
0
 public boolean endvisit(FullyQualifiedReference s) throws Exception {
   xmlWriter.endTag("FullyQualifiedReference");
   return true;
 }
Пример #26
0
 public boolean endvisit(PrefixExpression s) throws Exception {
   xmlWriter.endTag("PrefixExpression");
   return true;
 }
Пример #27
0
 public boolean endvisit(NamespaceReference s) throws Exception {
   xmlWriter.endTag("NamespaceReference");
   return true;
 }
Пример #28
0
 public boolean endvisit(UnaryOperation s) throws Exception {
   xmlWriter.endTag("UnaryOperation");
   return true;
 }
Пример #29
0
 public boolean endvisit(SwitchCase s) throws Exception {
   xmlWriter.endTag("SwitchCase");
   return true;
 }
Пример #30
0
 public boolean endvisit(PHPDocTag s) throws Exception {
   xmlWriter.endTag("PHPDocTag");
   return true;
 }