@Override
 public Boolean caseAssignment(Assignment object) {
   if (GrammarUtil.isMultipleAssignment(object)) return Boolean.FALSE;
   checkAssignment(object, object.getFeature());
   if (GrammarUtil.isMultipleCardinality(object)) checkAssignment(object, object.getFeature());
   return Boolean.FALSE;
 }
Beispiel #2
0
 private String getInheritedUniqueName(AbstractRule rule, Set<String> usedNames) {
   String grammarName = GrammarUtil.getSimpleName(GrammarUtil.getGrammar(rule));
   String candidate = grammarName + rule.getName();
   int i = 1;
   while (usedNames.contains(candidate)) {
     candidate = grammarName + i + rule.getName();
     i++;
   }
   return candidate;
 }
 @Override
 public Boolean caseCompoundElement(CompoundElement object) {
   Multimap<String, AbstractElement> prevAssignedFeatures = newMultimap(assignedFeatures);
   for (AbstractElement element : object.getElements()) {
     doSwitch(element);
   }
   if (GrammarUtil.isMultipleCardinality(object)) {
     for (AbstractElement element : object.getElements()) {
       doSwitch(element);
     }
   }
   if (GrammarUtil.isOptionalCardinality(object)) assignedFeatures.putAll(prevAssignedFeatures);
   return Boolean.FALSE;
 }
Beispiel #4
0
 /**
  * Returns the invocation of the element accessor method as full qualified Java statement.
  * Example: return
  * FowlerDslTestLanguageGrammarAccess.INSTANCE.prStatemachine().ele1AssignmentStates()
  *
  * @param ele the element
  * @return The java statement
  */
 public String gaFullAccessor(final AbstractElement ele) {
   Grammar _grammar = GrammarUtil.getGrammar(ele);
   String _gaSimpleName = this.gaSimpleName(_grammar);
   String _plus = (_gaSimpleName + ".INSTANCE.");
   String _gaRuleElementAccessor = this.gaRuleElementAccessor(ele);
   return (_plus + _gaRuleElementAccessor);
 }
Beispiel #5
0
 /**
  * Returns the invocation of the element accessor method for a GrammarAccess as Java statement.
  * Example: prStatemachine().ele1AssignmentStates()
  *
  * @param ele the element
  * @return The java statement
  */
 public String gaRuleElementAccessor(final AbstractElement ele) {
   AbstractRule _containingRule = GrammarUtil.containingRule(ele);
   String _gaElementsAccessor = this.gaElementsAccessor(_containingRule);
   String _plus = (_gaElementsAccessor + ".");
   String _gaElementAccessor = this.gaElementAccessor(ele);
   return (_plus + _gaElementAccessor);
 }
  public class FileElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule)
            GrammarUtil.findRuleForName(
                getGrammar(), "org.eclipse.xtext.idea.sdomain.SDomain.File");
    private final Assignment cElementsAssignment = (Assignment) rule.eContents().get(1);
    private final RuleCall cElementsElementParserRuleCall_0 =
        (RuleCall) cElementsAssignment.eContents().get(0);

    // File:
    //	elements+=Element*;
    @Override
    public ParserRule getRule() {
      return rule;
    }

    // elements+=Element*
    public Assignment getElementsAssignment() {
      return cElementsAssignment;
    }

    // Element
    public RuleCall getElementsElementParserRuleCall_0() {
      return cElementsElementParserRuleCall_0;
    }
  }
 public FlattenedGrammarAccess(final RuleNames names, final RuleFilter filter) {
   final Grammar grammar = names.getContextGrammar();
   Grammar flattenedGrammar = this.<Grammar>copy(grammar);
   String _name = grammar.getName();
   flattenedGrammar.setName(_name);
   LinkedHashMap<RuleWithParameterValues, AbstractRule> origToCopy =
       Maps.<RuleWithParameterValues, AbstractRule>newLinkedHashMap();
   List<AbstractRule> _rules = filter.getRules(grammar);
   boolean _isDiscardRuleTypeRef = filter.isDiscardRuleTypeRef();
   final ArrayList<AbstractRule> copies =
       this.copyRuleStubs(names, origToCopy, _rules, _isDiscardRuleTypeRef);
   EList<AbstractRule> _rules_1 = flattenedGrammar.getRules();
   Iterables.<AbstractRule>addAll(_rules_1, copies);
   Multimap<TerminalRule, AbstractRule> calledFrom = this.copyRuleBodies(copies, origToCopy);
   this.setHiddenTokens(flattenedGrammar, grammar, origToCopy);
   this.markAsFragment(calledFrom);
   boolean _isDiscardUnreachableRules = filter.isDiscardUnreachableRules();
   if (_isDiscardUnreachableRules) {
     Set<AbstractRule> usedRules = CollectionLiterals.<AbstractRule>newHashSet();
     boolean _isDiscardTerminalRules = filter.isDiscardTerminalRules();
     boolean _not = (!_isDiscardTerminalRules);
     if (_not) {
       List<TerminalRule> _allTerminalRules = GrammarUtil.allTerminalRules(flattenedGrammar);
       usedRules.addAll(_allTerminalRules);
     }
     UsedRulesFinder finder = new UsedRulesFinder(usedRules);
     finder.compute(flattenedGrammar);
     EList<AbstractRule> _rules_2 = flattenedGrammar.getRules();
     _rules_2.retainAll(usedRules);
   }
   this.flattenedGrammar = flattenedGrammar;
   OriginalGrammar _originalGrammar = new OriginalGrammar(grammar);
   _originalGrammar.attachToEmfObject(flattenedGrammar);
 }
Beispiel #8
0
  public class TypeElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Type");
    private final Alternatives cAlternatives = (Alternatives) rule.eContents().get(1);
    private final RuleCall cATypeParserRuleCall_0 = (RuleCall) cAlternatives.eContents().get(0);
    private final RuleCall cAnotherTypeParserRuleCall_1 =
        (RuleCall) cAlternatives.eContents().get(1);

    // Type returns root::AType:
    //	AType | AnotherType;
    public ParserRule getRule() {
      return rule;
    }

    // AType | AnotherType
    public Alternatives getAlternatives() {
      return cAlternatives;
    }

    // AType
    public RuleCall getATypeParserRuleCall_0() {
      return cATypeParserRuleCall_0;
    }

    // AnotherType
    public RuleCall getAnotherTypeParserRuleCall_1() {
      return cAnotherTypeParserRuleCall_1;
    }
  }
  public class QualifiedNameWithWildCardElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule)
            GrammarUtil.findRuleForName(
                getGrammar(), "org.eclipse.xtext.idea.sdomain.SDomain.QualifiedNameWithWildCard");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final RuleCall cQualifiedNameParserRuleCall_0 = (RuleCall) cGroup.eContents().get(0);
    private final Keyword cFullStopAsteriskKeyword_1 = (Keyword) cGroup.eContents().get(1);

    // QualifiedNameWithWildCard:
    //	QualifiedName '.*'?;
    @Override
    public ParserRule getRule() {
      return rule;
    }

    // QualifiedName '.*'?
    public Group getGroup() {
      return cGroup;
    }

    // QualifiedName
    public RuleCall getQualifiedNameParserRuleCall_0() {
      return cQualifiedNameParserRuleCall_0;
    }

    // '.*'?
    public Keyword getFullStopAsteriskKeyword_1() {
      return cFullStopAsteriskKeyword_1;
    }
  }
  public class SpaceElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Space");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cSpaceKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Assignment cValAssignment_1 = (Assignment) cGroup.eContents().get(1);
    private final RuleCall cValIDTerminalRuleCall_1_0 =
        (RuleCall) cValAssignment_1.eContents().get(0);

    // Space:
    //	"space" val=ID;
    public ParserRule getRule() {
      return rule;
    }

    // "space" val=ID
    public Group getGroup() {
      return cGroup;
    }

    // "space"
    public Keyword getSpaceKeyword_0() {
      return cSpaceKeyword_0;
    }

    // val=ID
    public Assignment getValAssignment_1() {
      return cValAssignment_1;
    }

    // ID
    public RuleCall getValIDTerminalRuleCall_1_0() {
      return cValIDTerminalRuleCall_1_0;
    }
  }
  public class FqnObjElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "FqnObj");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cFqnKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Assignment cNameAssignment_1 = (Assignment) cGroup.eContents().get(1);
    private final RuleCall cNameFQNParserRuleCall_1_0 =
        (RuleCall) cNameAssignment_1.eContents().get(0);

    // FqnObj:
    //	"fqn" name=FQN;
    public ParserRule getRule() {
      return rule;
    }

    // "fqn" name=FQN
    public Group getGroup() {
      return cGroup;
    }

    // "fqn"
    public Keyword getFqnKeyword_0() {
      return cFqnKeyword_0;
    }

    // name=FQN
    public Assignment getNameAssignment_1() {
      return cNameAssignment_1;
    }

    // FQN
    public RuleCall getNameFQNParserRuleCall_1_0() {
      return cNameFQNParserRuleCall_1_0;
    }
  }
 protected void write(EObject grammarElement, String value) {
   if (grammarElement instanceof AbstractElement) {
     Event first = queue.pollFirst();
     AbstractElement firstGrammarElement = first.grammarElement;
     CrossReference ref = GrammarUtil.containingCrossReference(firstGrammarElement);
     if (ref != null) firstGrammarElement = ref;
     if (firstGrammarElement == grammarElement && first.token.equals(value)) {
       // System.out.println("OK!");
     } else {
       GrammarElementTitleSwitch f =
           new GrammarElementTitleSwitch().showQualified().showAssignments();
       System.out.println(
           f.apply(firstGrammarElement)
               + "<>"
               + f.apply((AbstractElement) grammarElement)
               + "; "
               + first.token
               + "<>"
               + value);
     }
     delegate.accept(first.sementicElement, first.grammarElement, value, false);
   } else {
     delegate.accept(null, grammarElement, value, true);
   }
 }
 public void testMetamodel() throws Exception {
   AbstractRule rule =
       GrammarUtil.findRuleForName(getGrammarAccess().getGrammar(), "OverridableParserRule2");
   assertNotNull("rule", rule);
   TypeRef ref = rule.getType();
   assertNotNull("ref", ref);
   final EClass clazz = (EClass) ref.getClassifier();
   assertNotNull("class", clazz);
   assertEquals("AType2", clazz.getName());
   assertEquals(2, clazz.getESuperTypes().size());
   Set<String> expectedNames =
       new HashSet<String>(Arrays.asList(new String[] {"AType", "RootRule"}));
   Iterator<String> iter =
       Iterables.transform(
               clazz.getESuperTypes(),
               new Function<EClass, String>() {
                 public String apply(EClass param) {
                   return param.getName();
                 }
               })
           .iterator();
   while (iter.hasNext()) {
     String name = iter.next();
     assertTrue("name = '" + name + "'", expectedNames.remove(name));
   }
   assertTrue(expectedNames.toString(), expectedNames.isEmpty());
 }
Beispiel #14
0
 @Override
 public Boolean caseUnorderedGroup(UnorderedGroup object) {
   if (object == this.group) {
     boolean more = true;
     for (AbstractElement element : object.getElements()) {
       if (handledAlternatives == null || !handledAlternatives.contains(element)) {
         this.group = null;
         more = doSwitch(element) && more;
         this.group = object;
       }
     }
     if (more && GrammarUtil.isMultipleCardinality(object)) {
       handledAlternatives = null;
       this.group = null;
       return caseUnorderedGroup(object);
     }
     return more || isOptional(object);
   } else {
     boolean more = true;
     for (AbstractElement element : object.getElements()) {
       more = doSwitch(element) && more;
     }
     return more || isOptional(object);
   }
 }
 public String defaultValue(final AbstractElement ele, final Set<AbstractElement> visited) {
   String _switchResult = null;
   boolean _matched = false;
   if (!_matched) {
     boolean _add = visited.add(ele);
     boolean _not = (!_add);
     if (_not) {
       _matched = true;
       _switchResult = "";
     }
   }
   if (!_matched) {
     boolean _isOptionalCardinality = GrammarUtil.isOptionalCardinality(ele);
     if (_isOptionalCardinality) {
       _matched = true;
       _switchResult = "";
     }
   }
   if (!_matched) {
     if (ele instanceof Alternatives) {
       _matched = true;
       EList<AbstractElement> _elements = ((Alternatives) ele).getElements();
       AbstractElement _head = IterableExtensions.<AbstractElement>head(_elements);
       _switchResult = this.defaultValue(_head, visited);
     }
   }
   if (!_matched) {
     if (ele instanceof Group) {
       _matched = true;
       EList<AbstractElement> _elements = ((Group) ele).getElements();
       final Function1<AbstractElement, String> _function =
           new Function1<AbstractElement, String>() {
             @Override
             public String apply(final AbstractElement e) {
               return AbstractSyntacticSequencer.this.defaultValue(e, visited);
             }
           };
       List<String> _map = ListExtensions.<AbstractElement, String>map(_elements, _function);
       _switchResult = IterableExtensions.join(_map);
     }
   }
   if (!_matched) {
     if (ele instanceof Keyword) {
       _matched = true;
       _switchResult = ((Keyword) ele).getValue();
     }
   }
   if (!_matched) {
     if (ele instanceof RuleCall) {
       _matched = true;
       AbstractRule _rule = ((RuleCall) ele).getRule();
       AbstractElement _alternatives = _rule.getAlternatives();
       _switchResult = this.defaultValue(_alternatives, visited);
     }
   }
   if (!_matched) {
     _switchResult = "";
   }
   return _switchResult;
 }
 public static String getParameterList(ParserRule rule, Boolean skipCurrent) {
   boolean currentAsParam = rule.isFragment() && !GrammarUtil.isDatatypeRule(rule);
   if ((skipCurrent || !currentAsParam) && rule.getParameters().isEmpty()) {
     return "";
   }
   StringBuilder result = new StringBuilder();
   result.append("[");
   if (!skipCurrent) {
     if (currentAsParam) {
       result.append("EObject in_current");
       if (!rule.getParameters().isEmpty()) {
         result.append(", ");
       }
     }
   }
   Joiner.on(", ")
       .appendTo(
           result,
           Iterables.transform(
               rule.getParameters(),
               new Function<Parameter, String>() {
                 @Override
                 public String apply(Parameter input) {
                   return "boolean p_" + input.getName();
                 }
               }));
   result.append("] ");
   return result.toString();
 }
  public class CompositeTypeEntryElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule)
            GrammarUtil.findRuleForName(
                getGrammar(),
                "org.eclipse.xtext.ui.tests.editor.contentassist.DatatypeRuleTestLanguage.CompositeTypeEntry");
    private final Assignment cDataTypeAssignment = (Assignment) rule.eContents().get(1);
    private final CrossReference cDataTypeTypeCrossReference_0 =
        (CrossReference) cDataTypeAssignment.eContents().get(0);
    private final RuleCall cDataTypeTypeTypeIdParserRuleCall_0_1 =
        (RuleCall) cDataTypeTypeCrossReference_0.eContents().get(1);

    // CompositeTypeEntry:
    //	dataType=[Type|TypeId];
    @Override
    public ParserRule getRule() {
      return rule;
    }

    // dataType=[Type|TypeId]
    public Assignment getDataTypeAssignment() {
      return cDataTypeAssignment;
    }

    // [Type|TypeId]
    public CrossReference getDataTypeTypeCrossReference_0() {
      return cDataTypeTypeCrossReference_0;
    }

    // TypeId
    public RuleCall getDataTypeTypeTypeIdParserRuleCall_0_1() {
      return cDataTypeTypeTypeIdParserRuleCall_0_1;
    }
  }
 @Override
 protected List<INode> getLocationNodes(EObject obj) {
   if (obj instanceof XMemberFeatureCall
       || obj instanceof XAssignment
       || obj instanceof XFeatureCall) {
     List<INode> resultNodes = Lists.newArrayList();
     final ICompositeNode startNode = findNodeFor(obj);
     boolean crossRefConsumed = false;
     for (INode child : startNode.getChildren()) {
       if (crossRefConsumed) {
         resultNodes.add(child);
       } else {
         EObject grammarElement = child.getGrammarElement();
         if (grammarElement instanceof CrossReference) {
           // We don't use the grammar access to be more robust against
           // overwriting grammars
           Assignment assignment = GrammarUtil.containingAssignment(grammarElement);
           if (XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE
               .getName()
               .equals(assignment.getFeature())) {
             crossRefConsumed = true;
             resultNodes.add(child);
           }
         }
       }
     }
     if (!resultNodes.isEmpty()) return resultNodes;
   }
   return super.getLocationNodes(obj);
 }
  public class TypeElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule)
            GrammarUtil.findRuleForName(
                getGrammar(),
                "org.eclipse.xtext.ui.tests.editor.contentassist.DatatypeRuleTestLanguage.Type");
    private final Alternatives cAlternatives = (Alternatives) rule.eContents().get(1);
    private final RuleCall cSimpleTypeParserRuleCall_0 =
        (RuleCall) cAlternatives.eContents().get(0);
    private final RuleCall cCompositeTypeParserRuleCall_1 =
        (RuleCall) cAlternatives.eContents().get(1);

    // Type:
    //	SimpleType | CompositeType;
    @Override
    public ParserRule getRule() {
      return rule;
    }

    // SimpleType | CompositeType
    public Alternatives getAlternatives() {
      return cAlternatives;
    }

    // SimpleType
    public RuleCall getSimpleTypeParserRuleCall_0() {
      return cSimpleTypeParserRuleCall_0;
    }

    // CompositeType
    public RuleCall getCompositeTypeParserRuleCall_1() {
      return cCompositeTypeParserRuleCall_1;
    }
  }
 protected String _grammarElementIdentifier(final AbstractElement it) {
   AbstractRule _containingRule = GrammarUtil.containingRule(it);
   String _grammarElementIdentifier = this.grammarElementIdentifier(_containingRule);
   String _plus = (_grammarElementIdentifier + "_");
   String _gaElementIdentifyer = this._grammarAccess.gaElementIdentifyer(it);
   return (_plus + _gaElementIdentifyer);
 }
  public class EnumerationElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Enumeration");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cEnumKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Assignment cValAssignment_1 = (Assignment) cGroup.eContents().get(1);
    private final RuleCall cValEnum1EnumRuleCall_1_0 =
        (RuleCall) cValAssignment_1.eContents().get(0);
    private final Group cGroup_2 = (Group) cGroup.eContents().get(2);
    private final Keyword cCommaKeyword_2_0 = (Keyword) cGroup_2.eContents().get(0);
    private final Assignment cValAssignment_2_1 = (Assignment) cGroup_2.eContents().get(1);
    private final RuleCall cValEnum1EnumRuleCall_2_1_0 =
        (RuleCall) cValAssignment_2_1.eContents().get(0);

    // Enumeration:
    //	"enum" val+=Enum1+ ("," val+=Enum1)*;
    public ParserRule getRule() {
      return rule;
    }

    // "enum" val+=Enum1+ ("," val+=Enum1)*
    public Group getGroup() {
      return cGroup;
    }

    // "enum"
    public Keyword getEnumKeyword_0() {
      return cEnumKeyword_0;
    }

    // val+=Enum1+
    public Assignment getValAssignment_1() {
      return cValAssignment_1;
    }

    // Enum1
    public RuleCall getValEnum1EnumRuleCall_1_0() {
      return cValEnum1EnumRuleCall_1_0;
    }

    // ("," val+=Enum1)*
    public Group getGroup_2() {
      return cGroup_2;
    }

    // ","
    public Keyword getCommaKeyword_2_0() {
      return cCommaKeyword_2_0;
    }

    // val+=Enum1
    public Assignment getValAssignment_2_1() {
      return cValAssignment_2_1;
    }

    // Enum1
    public RuleCall getValEnum1EnumRuleCall_2_1_0() {
      return cValEnum1EnumRuleCall_2_1_0;
    }
  }
  public class TypeElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule)
            GrammarUtil.findRuleForName(
                getGrammar(), "org.eclipse.xtext.idea.sdomain.SDomain.Type");
    private final Alternatives cAlternatives = (Alternatives) rule.eContents().get(1);
    private final RuleCall cEntityParserRuleCall_0 = (RuleCall) cAlternatives.eContents().get(0);
    private final RuleCall cDatatypeParserRuleCall_1 = (RuleCall) cAlternatives.eContents().get(1);

    // Type:
    //	Entity | Datatype;
    @Override
    public ParserRule getRule() {
      return rule;
    }

    // Entity | Datatype
    public Alternatives getAlternatives() {
      return cAlternatives;
    }

    // Entity
    public RuleCall getEntityParserRuleCall_0() {
      return cEntityParserRuleCall_0;
    }

    // Datatype
    public RuleCall getDatatypeParserRuleCall_1() {
      return cDatatypeParserRuleCall_1;
    }
  }
 protected String _localVar(final EnumLiteralDeclaration it) {
   EnumRule _containingEnumRule = GrammarUtil.containingEnumRule(it);
   AbstractElement _alternatives = _containingEnumRule.getAlternatives();
   List<AbstractElement> _contentsAsList = this.contentsAsList(_alternatives);
   int _indexOf = _contentsAsList.indexOf(it);
   return ("enumLiteral_" + Integer.valueOf(_indexOf));
 }
  public class SuppressedHiddenSubElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "SuppressedHiddenSub");
    private final Alternatives cAlternatives = (Alternatives) rule.eContents().get(1);
    private final RuleCall cSuppressedHiddenSubSubParserRuleCall_0 =
        (RuleCall) cAlternatives.eContents().get(0);
    private final RuleCall cSuppressedHiddenSubIDParserRuleCall_1 =
        (RuleCall) cAlternatives.eContents().get(1);

    // SuppressedHiddenSub:
    //	SuppressedHiddenSubSub | SuppressedHiddenSubID;
    public ParserRule getRule() {
      return rule;
    }

    // SuppressedHiddenSubSub | SuppressedHiddenSubID
    public Alternatives getAlternatives() {
      return cAlternatives;
    }

    // SuppressedHiddenSubSub
    public RuleCall getSuppressedHiddenSubSubParserRuleCall_0() {
      return cSuppressedHiddenSubSubParserRuleCall_0;
    }

    // SuppressedHiddenSubID
    public RuleCall getSuppressedHiddenSubIDParserRuleCall_1() {
      return cSuppressedHiddenSubIDParserRuleCall_1;
    }
  }
Beispiel #25
0
  public class AnotherTypeElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "AnotherType");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cBarKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Action cAnotherTypeAction_1 = (Action) cGroup.eContents().get(1);

    // AnotherType returns sub::AnotherType:
    //	"bar" {sub::AnotherType};
    public ParserRule getRule() {
      return rule;
    }

    // "bar" {sub::AnotherType}
    public Group getGroup() {
      return cGroup;
    }

    // "bar"
    public Keyword getBarKeyword_0() {
      return cBarKeyword_0;
    }

    // {sub::AnotherType}
    public Action getAnotherTypeAction_1() {
      return cAnotherTypeAction_1;
    }
  }
 protected static Set<String> computeRestrictedKeywords(Grammar grammar) {
   Set<String> keywords = new HashSet<String>(GrammarUtil.getAllKeywords(grammar));
   Set<String> unrestrictedNames = getAllKeywords(grammar, "UnrestrictedName");
   keywords.removeAll(unrestrictedNames);
   //			printKeywords("Unrestricted", unrestrictedNames);
   return keywords;
 }
Beispiel #27
0
  public class ATypeElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "AType");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cFooKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Action cATypeAction_1 = (Action) cGroup.eContents().get(1);

    // AType returns root::AType:
    //	"foo" {root::AType};
    public ParserRule getRule() {
      return rule;
    }

    // "foo" {root::AType}
    public Group getGroup() {
      return cGroup;
    }

    // "foo"
    public Keyword getFooKeyword_0() {
      return cFooKeyword_0;
    }

    // {root::AType}
    public Action getATypeAction_1() {
      return cATypeAction_1;
    }
  }
Beispiel #28
0
  public class AbstractCallOverridenParserRuleElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "AbstractCallOverridenParserRule");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cOverridemodelKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Assignment cElementsAssignment_1 = (Assignment) cGroup.eContents().get(1);
    private final RuleCall cElementsOverridableParserRuleParserRuleCall_1_0 =
        (RuleCall) cElementsAssignment_1.eContents().get(0);

    // AbstractCallOverridenParserRule returns mm::AModel:
    //	"overridemodel" elements+=OverridableParserRule*;
    public ParserRule getRule() {
      return rule;
    }

    // "overridemodel" elements+=OverridableParserRule*
    public Group getGroup() {
      return cGroup;
    }

    // "overridemodel"
    public Keyword getOverridemodelKeyword_0() {
      return cOverridemodelKeyword_0;
    }

    // elements+=OverridableParserRule*
    public Assignment getElementsAssignment_1() {
      return cElementsAssignment_1;
    }

    // OverridableParserRule
    public RuleCall getElementsOverridableParserRuleParserRuleCall_1_0() {
      return cElementsOverridableParserRuleParserRuleCall_1_0;
    }
  }
Beispiel #29
0
  public class OverridableParserRuleElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "OverridableParserRule");
    private final Group cGroup = (Group) rule.eContents().get(1);
    private final Keyword cElementKeyword_0 = (Keyword) cGroup.eContents().get(0);
    private final Assignment cNameAssignment_1 = (Assignment) cGroup.eContents().get(1);
    private final RuleCall cNameIDTerminalRuleCall_1_0 =
        (RuleCall) cNameAssignment_1.eContents().get(0);

    // OverridableParserRule returns mm::AType:
    //	"element" name=ID;
    public ParserRule getRule() {
      return rule;
    }

    // "element" name=ID
    public Group getGroup() {
      return cGroup;
    }

    // "element"
    public Keyword getElementKeyword_0() {
      return cElementKeyword_0;
    }

    // name=ID
    public Assignment getNameAssignment_1() {
      return cNameAssignment_1;
    }

    // ID
    public RuleCall getNameIDTerminalRuleCall_1_0() {
      return cNameIDTerminalRuleCall_1_0;
    }
  }
  public class FunctionsTblElements extends AbstractParserRuleElementFinder {
    private final ParserRule rule =
        (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "FunctionsTbl");
    private final Alternatives cAlternatives = (Alternatives) rule.eContents().get(1);
    private final Keyword cIsnullKeyword_0 = (Keyword) cAlternatives.eContents().get(0);
    private final Keyword cInKeyword_1 = (Keyword) cAlternatives.eContents().get(1);
    private final Keyword cOutKeyword_2 = (Keyword) cAlternatives.eContents().get(2);

    // FunctionsTbl:
    //	"isnull" | "in" | "out";
    public ParserRule getRule() {
      return rule;
    }

    // "isnull" | "in" | "out"
    public Alternatives getAlternatives() {
      return cAlternatives;
    }

    // "isnull"
    public Keyword getIsnullKeyword_0() {
      return cIsnullKeyword_0;
    }

    // "in"
    public Keyword getInKeyword_1() {
      return cInKeyword_1;
    }

    // "out"
    public Keyword getOutKeyword_2() {
      return cOutKeyword_2;
    }
  }