Exemple #1
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;
  }
Exemple #2
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;
 }
Exemple #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;
 }
Exemple #4
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;
  }
Exemple #5
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;
 }
Exemple #6
0
 public boolean visit(Scalar s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("type", s.getType());
   parameters.put("value", s.getValue());
   xmlWriter.startTag("Scalar", parameters);
   return true;
 }
Exemple #7
0
 public boolean visit(ArrayVariableReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("type", ArrayVariableReference.getArrayType(s.getArrayType()));
   parameters.put("name", s.getName());
   xmlWriter.startTag("ArrayVariableReference", parameters);
   return true;
 }
Exemple #8
0
 public boolean visit(PHPDocTag s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("tagKind", PHPDocTag.getTagKind(s.getTagKind()));
   parameters.put("value", s.getValue());
   xmlWriter.startTag("PHPDocTag", parameters);
   return true;
 }
Exemple #9
0
 public boolean visit(NamespaceReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("name", s.getName());
   parameters.put("global", Boolean.toString(s.isGlobal()));
   parameters.put("local", Boolean.toString(s.isLocal()));
   xmlWriter.startTag("NamespaceReference", parameters);
   return true;
 }
Exemple #10
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;
  }
Exemple #11
0
  public boolean visit(TraitAlias s) throws Exception {
    Map<String, String> parameters = createInitialParameters(s);
    if (s.getMethodName() != null) {
      parameters.put("methodName", s.getMethodName().getName());
    }

    xmlWriter.startTag("TraitAlias", parameters);
    return true;
  }
Exemple #12
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;
  }
Exemple #13
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;
  }
Exemple #14
0
 public boolean visit(WhileStatement s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("WhileStatement", parameters);
   return true;
 }
Exemple #15
0
 public boolean visit(UnaryOperation s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("operator", s.getOperator());
   xmlWriter.startTag("UnaryOperation", parameters);
   return true;
 }
Exemple #16
0
 public boolean visit(FullyQualifiedReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("name", s.getFullyQualifiedName());
   xmlWriter.startTag("FullyQualifiedReference", parameters);
   return true;
 }
Exemple #17
0
 public boolean visit(SwitchCase s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("SwitchCase", parameters);
   return true;
 }
Exemple #18
0
 public boolean visit(StaticMethodInvocation s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("StaticMethodInvocation", parameters);
   return true;
 }
Exemple #19
0
 public boolean visit(PHPCallArgumentsList s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("PHPCallArgumentsList", parameters);
   return true;
 }
Exemple #20
0
 public boolean visit(FormalParameter s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("isMandatory", Boolean.toString(s.isMandatory()));
   xmlWriter.startTag("FormalParameter", parameters);
   return true;
 }
Exemple #21
0
 public boolean visit(ReflectionVariableReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ReflectionVariableReference", parameters);
   return true;
 }
Exemple #22
0
 public boolean visit(FormalParameterByReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("FormalParameterByReference", parameters);
   return true;
 }
Exemple #23
0
 public boolean visit(IgnoreError s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("IgnoreError", parameters);
   return true;
 }
Exemple #24
0
 public boolean visit(PHPDocBlock s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("shortDescription", s.getShortDescription());
   xmlWriter.startTag("PHPDocBlock", parameters);
   return true;
 }
Exemple #25
0
 public boolean visit(ModuleDeclaration s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ModuleDeclaration", parameters);
   return true;
 }
Exemple #26
0
 public boolean visit(StaticFieldAccess s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("StaticFieldAccess", parameters);
   return true;
 }
Exemple #27
0
 public boolean visit(NamespaceDeclaration s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("name", s.getName());
   xmlWriter.startTag("NamespaceDeclaration", parameters);
   return true;
 }
Exemple #28
0
 public boolean visit(ListVariable s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ListVariable", parameters);
   return true;
 }
Exemple #29
0
 public boolean visit(Quote s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("type", Quote.getType(s.getQuoteType()));
   xmlWriter.startTag("Quote", parameters);
   return true;
 }
Exemple #30
0
 public boolean visit(ReflectionCallExpression s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ReflectionCallExpression", parameters);
   return true;
 }