org.eclipse.xtext
Class GrammarUtil
java.lang.Object
org.eclipse.xtext.GrammarUtil
public class GrammarUtil
- extends java.lang.Object
- Author:
- Jan Koehnlein, Sven Efftinge, Heiko Behrens, Sebastian Zarnekow
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GrammarUtil
public GrammarUtil()
getClasspathRelativePathToXmi
public static java.lang.String getClasspathRelativePathToXmi(Grammar grammar)
getLanguageId
public static java.lang.String getLanguageId(Grammar g)
getName
public static java.lang.String getName(Grammar g)
getNamespace
public static java.lang.String getNamespace(Grammar g)
getGrammar
public static Grammar getGrammar(org.eclipse.emf.ecore.EObject grammarElement)
containingRule
public static AbstractRule containingRule(org.eclipse.emf.ecore.EObject e)
containingParserRule
public static ParserRule containingParserRule(org.eclipse.emf.ecore.EObject e)
containingEnumRule
public static EnumRule containingEnumRule(org.eclipse.emf.ecore.EObject e)
containingAssignment
public static Assignment containingAssignment(org.eclipse.emf.ecore.EObject e)
containingGroup
public static Group containingGroup(org.eclipse.emf.ecore.EObject e)
containingUnorderedGroup
public static UnorderedGroup containingUnorderedGroup(org.eclipse.emf.ecore.EObject e)
containingCrossReference
public static CrossReference containingCrossReference(org.eclipse.emf.ecore.EObject e)
containedActions
public static java.util.List<Action> containedActions(org.eclipse.emf.ecore.EObject e)
containedRuleCalls
public static java.util.List<RuleCall> containedRuleCalls(org.eclipse.emf.ecore.EObject e)
containedAssignments
public static java.util.List<Assignment> containedAssignments(org.eclipse.emf.ecore.EObject e)
containedKeywords
public static java.util.List<Keyword> containedKeywords(org.eclipse.emf.ecore.EObject e)
containedAbstractElements
public static java.util.List<AbstractElement> containedAbstractElements(org.eclipse.emf.ecore.EObject e)
containedCrossReferences
public static java.util.List<CrossReference> containedCrossReferences(org.eclipse.emf.ecore.EObject e)
containsAssignedAction
public static boolean containsAssignedAction(ParserRule rule)
- Since:
- 2.0
elementsBeforeThisInContainingGroup
public static java.util.List<AbstractElement> elementsBeforeThisInContainingGroup(AbstractElement _this)
isParserRuleCall
public static boolean isParserRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
isEObjectRuleCall
public static boolean isEObjectRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
isEObjectRule
public static boolean isEObjectRule(org.eclipse.emf.ecore.EObject grammarElement)
- Since:
- 2.0
isUnassignedParserRuleCall
public static boolean isUnassignedParserRuleCall(org.eclipse.emf.ecore.EObject ele)
- Since:
- 2.0
isUnassignedEObjectRuleCall
public static boolean isUnassignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele)
- Since:
- 2.0
isAssignedEObjectRuleCall
public static boolean isAssignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele)
- Since:
- 2.0
isDatatypeRuleCall
public static boolean isDatatypeRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
isEnumRuleCall
public static boolean isEnumRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
isTerminalRuleCall
public static boolean isTerminalRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
- Since:
- 2.0
findRuleForName
public static AbstractRule findRuleForName(Grammar grammar,
java.lang.String ruleName)
allUsedGrammars
public static java.util.List<Grammar> allUsedGrammars(Grammar grammar)
allRules
public static java.util.List<AbstractRule> allRules(Grammar grammar)
allParserRules
public static java.util.List<ParserRule> allParserRules(Grammar _this)
allEnumRules
public static java.util.List<EnumRule> allEnumRules(Grammar _this)
allTerminalRules
public static java.util.List<TerminalRule> allTerminalRules(Grammar _this)
allMetamodelDeclarations
public static java.util.List<AbstractMetamodelDeclaration> allMetamodelDeclarations(Grammar grammar)
getTypeRefName
public static java.lang.String getTypeRefName(TypeRef typeRef)
isAssigned
public static boolean isAssigned(org.eclipse.emf.ecore.EObject e)
isAssignedAction
public static boolean isAssignedAction(org.eclipse.emf.ecore.EObject e)
isUnassignedAction
public static boolean isUnassignedAction(org.eclipse.emf.ecore.EObject e)
getAllKeywords
public static java.util.Set<java.lang.String> getAllKeywords(Grammar g)
isBooleanAssignment
public static boolean isBooleanAssignment(Assignment a)
isSingleAssignment
public static boolean isSingleAssignment(Assignment a)
isMultipleAssignment
public static boolean isMultipleAssignment(Assignment a)
isMultipleAssignment
public static boolean isMultipleAssignment(Action a)
isOptionalCardinality
public static boolean isOptionalCardinality(AbstractElement e)
isMultipleCardinality
public static boolean isMultipleCardinality(AbstractElement e)
isOneOrMoreCardinality
public static boolean isOneOrMoreCardinality(AbstractElement e)
isAnyCardinality
public static boolean isAnyCardinality(AbstractElement e)
isDatatypeRule
public static boolean isDatatypeRule(ParserRule parserRule)
isDatatypeRule
public static boolean isDatatypeRule(AbstractRule abstractRule)
getReference
public static org.eclipse.emf.ecore.EReference getReference(CrossReference ref,
org.eclipse.emf.ecore.EClass referenceOwner)
getReference
public static org.eclipse.emf.ecore.EReference getReference(CrossReference crossRef)
findCurrentType
public static org.eclipse.emf.ecore.EClassifier findCurrentType(AbstractElement element)
allEPackagesToValidate
public static java.util.Collection<org.eclipse.emf.ecore.EPackage> allEPackagesToValidate(Grammar _this)