Package org.eclipse.xtext.grammaranalysis.impl

Examples of org.eclipse.xtext.grammaranalysis.impl.GrammarElementTitleSwitch


    // if(node == null)
    // result.append("-");

    if(!node.isLeaf()) {
      if(node.getGrammarElement() != null)
        result.append(new GrammarElementTitleSwitch().showAssignments().doSwitch(node.getGrammarElement()));
      else
        result.append("(unknown)");
      appendTypeAndClassifiers(result, node);

      String newPrefix = prefix + "  ";
      result.append(" {");
      Iterator<? extends IDomNode> children = node.getChildren().iterator();
      while(children.hasNext()) {
        IDomNode child = children.next();
        compactDump(child, showHidden, newPrefix, result);
      }
      result.append("\n");
      result.append(prefix);
      result.append("}");

      // appendTypeAndClassifiers(result, node);
      appendEffectiveStyle(result, node, "");

      if(containsError(node) && node.getNode() != null) {
        SyntaxErrorMessage error = node.getNode().getSyntaxErrorMessage();
        if(error != null)
          result.append(" SyntaxError: [" + error.getIssueCode() + "] " + error.getMessage());
      }
    }
    else if(node.isLeaf()) {
      // it is a leaf
      if(isHidden(node))
        result.append("hidden ");
      if(node.getGrammarElement() != null)
        result.append(new GrammarElementTitleSwitch().showAssignments().doSwitch(node.getGrammarElement()));
      else
        result.append("(unknown)");
      // result.append(" => '");
      // result.append(encodedString(node.getText()));
      // result.append("'");
View Full Code Here


      }
      else {
        Semantic semantic = (Semantic) e;
        builder.append("Semantic: ");
        builder.append(semantic.getSemantic().getClass().getSimpleName()).append(", ");
        builder.append(new GrammarElementTitleSwitch().doSwitch(semantic.getFirstNode().getGrammarElement()));
        builder.append(", ");
        builder.append(new GrammarElementTitleSwitch().doSwitch(semantic.getLastNode().getGrammarElement()));
        builder.append("\n");
      }
    }
    System.out.print(builder.toString());
View Full Code Here

    if(prefix.length() != 0) {
      result.append("\n");
      result.append(prefix);
    }
    if(node instanceof ICompositeNode) {
      result.append(new GrammarElementTitleSwitch().doSwitch(node.getGrammarElement()));
      String newPrefix = prefix + "  ";
      result.append(" {");
      BidiIterator<INode> children = ((ICompositeNode) node).getChildren().iterator();
      while(children.hasNext()) {
        INode child = children.next();
        compactDump(child, showHidden, newPrefix, result);
      }
      result.append("\n");
      result.append(prefix);
      result.append("}");
    }
    else if(node instanceof ILeafNode) {
      if(((ILeafNode) node).isHidden())
        result.append("hidden ");
      if(node.getGrammarElement() == null)
        result.append("error");
      else
        result.append(new GrammarElementTitleSwitch().doSwitch(node.getGrammarElement()));
      result.append(" => '");
      result.append(node.getText());
      result.append("'");
    }
    else if(node == null) {
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.grammaranalysis.impl.GrammarElementTitleSwitch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.