Beispiel #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;
  }
Beispiel #2
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;
 }
Beispiel #3
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;
 }