예제 #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;
  }
예제 #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;
 }
예제 #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 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;
  }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
  }
예제 #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;
  }
예제 #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;
  }
예제 #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;
  }
예제 #14
0
 public boolean visit(WhileStatement s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("WhileStatement", parameters);
   return true;
 }
예제 #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;
 }
예제 #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;
 }
예제 #17
0
 public boolean visit(SwitchCase s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("SwitchCase", parameters);
   return true;
 }
예제 #18
0
 public boolean visit(StaticMethodInvocation s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("StaticMethodInvocation", parameters);
   return true;
 }
예제 #19
0
 public boolean visit(PHPCallArgumentsList s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("PHPCallArgumentsList", parameters);
   return true;
 }
예제 #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;
 }
예제 #21
0
 public boolean visit(ReflectionVariableReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ReflectionVariableReference", parameters);
   return true;
 }
예제 #22
0
 public boolean visit(FormalParameterByReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("FormalParameterByReference", parameters);
   return true;
 }
예제 #23
0
 public boolean visit(IgnoreError s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("IgnoreError", parameters);
   return true;
 }
예제 #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;
 }
예제 #25
0
 public boolean visit(ModuleDeclaration s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ModuleDeclaration", parameters);
   return true;
 }
예제 #26
0
 public boolean visit(StaticFieldAccess s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("StaticFieldAccess", parameters);
   return true;
 }
예제 #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;
 }
예제 #28
0
 public boolean visit(ListVariable s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ListVariable", parameters);
   return true;
 }
예제 #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;
 }
예제 #30
0
 public boolean visit(ReflectionCallExpression s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   xmlWriter.startTag("ReflectionCallExpression", parameters);
   return true;
 }