public class GrammarUtil
extends java.lang.Object
Constructor and Description |
---|
GrammarUtil() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<EnumRule> |
allEnumRules(Grammar _this) |
static java.util.Collection<org.eclipse.emf.ecore.EPackage> |
allEPackagesToValidate(Grammar _this) |
static java.util.List<AbstractMetamodelDeclaration> |
allMetamodelDeclarations(Grammar grammar) |
static java.util.List<ParserRule> |
allParserRules(Grammar _this) |
static java.util.List<AbstractRule> |
allRules(Grammar grammar) |
static java.util.List<TerminalRule> |
allTerminalRules(Grammar _this) |
static java.util.List<Grammar> |
allUsedGrammars(Grammar grammar) |
static java.util.List<AbstractElement> |
containedAbstractElements(org.eclipse.emf.ecore.EObject e) |
static java.util.List<Action> |
containedActions(org.eclipse.emf.ecore.EObject e) |
static java.util.List<Assignment> |
containedAssignments(org.eclipse.emf.ecore.EObject e) |
static java.util.List<CrossReference> |
containedCrossReferences(org.eclipse.emf.ecore.EObject e) |
static java.util.List<Keyword> |
containedKeywords(org.eclipse.emf.ecore.EObject e) |
static java.util.List<RuleCall> |
containedRuleCalls(org.eclipse.emf.ecore.EObject e) |
static Assignment |
containingAssignment(org.eclipse.emf.ecore.EObject e) |
static CrossReference |
containingCrossReference(org.eclipse.emf.ecore.EObject e) |
static EnumRule |
containingEnumRule(org.eclipse.emf.ecore.EObject e) |
static Group |
containingGroup(org.eclipse.emf.ecore.EObject e) |
static ParserRule |
containingParserRule(org.eclipse.emf.ecore.EObject e) |
static AbstractRule |
containingRule(org.eclipse.emf.ecore.EObject e) |
static UnorderedGroup |
containingUnorderedGroup(org.eclipse.emf.ecore.EObject e) |
static boolean |
containsAssignedAction(ParserRule rule) |
static java.util.List<AbstractElement> |
elementsBeforeThisInContainingGroup(AbstractElement _this) |
static org.eclipse.emf.ecore.EClassifier |
findCurrentType(AbstractElement element) |
static org.eclipse.emf.ecore.EDataType |
findEBoolean(Grammar grammar)
Find the datatype for EBoolean which is referable from the given grammar.
|
static org.eclipse.emf.ecore.EClass |
findEObject(Grammar grammar)
Find the class for EObject which is referable from the given grammar.
|
static org.eclipse.emf.ecore.EDataType |
findEString(Grammar grammar)
Find the datatype for EString which is referable from the given grammar.
|
static AbstractRule |
findRuleForName(Grammar grammar,
java.lang.String ruleName) |
static java.util.Collection<? extends AbstractElement> |
getAllAlternatives(Grammar g) |
static java.util.Collection<? extends AbstractElement> |
getAllAssignments(Grammar g) |
static java.util.Collection<? extends AbstractElement> |
getAllGroups(Grammar g) |
static java.util.Set<java.lang.String> |
getAllKeywords(Grammar g) |
static java.util.Collection<? extends AbstractElement> |
getAllPredicatedElements(Grammar g) |
static java.util.Collection<? extends AbstractElement> |
getAllUnorderedGroups(Grammar g) |
static java.lang.String |
getClasspathRelativePathToBinGrammar(Grammar grammar) |
static java.lang.String |
getClasspathRelativePathToXmi(Grammar grammar) |
static Grammar |
getGrammar(org.eclipse.emf.ecore.EObject grammarElement) |
static java.lang.String |
getLanguageId(Grammar g) |
static java.lang.String |
getName(Grammar g)
Deprecated.
replaced by
getSimpleName(Grammar) for more clarity |
static java.lang.String |
getNamespace(Grammar g) |
static org.eclipse.emf.ecore.EReference |
getReference(CrossReference crossRef) |
static org.eclipse.emf.ecore.EReference |
getReference(CrossReference ref,
org.eclipse.emf.ecore.EClass referenceOwner) |
static java.lang.String |
getSimpleName(Grammar g) |
static java.lang.String |
getTypeRefName(TypeRef typeRef) |
static boolean |
isAnyCardinality(AbstractElement e) |
static boolean |
isAssigned(org.eclipse.emf.ecore.EObject e) |
static boolean |
isAssignedAction(org.eclipse.emf.ecore.EObject e) |
static boolean |
isAssignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele) |
static boolean |
isBooleanAssignment(Assignment a) |
static boolean |
isDatatypeRule(AbstractRule abstractRule) |
static boolean |
isDatatypeRule(ParserRule parserRule) |
static boolean |
isDatatypeRuleCall(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isEnumRuleCall(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isEObjectFragmentRule(AbstractRule rule) |
static boolean |
isEObjectFragmentRuleCall(org.eclipse.emf.ecore.EObject ele) |
static boolean |
isEObjectRule(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isEObjectRuleCall(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isMultipleAssignment(Action a) |
static boolean |
isMultipleAssignment(Assignment a) |
static boolean |
isMultipleCardinality(AbstractElement e) |
static boolean |
isOneOrMoreCardinality(AbstractElement e) |
static boolean |
isOptionalCardinality(AbstractElement e) |
static boolean |
isParserRuleCall(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isSingleAssignment(Assignment a) |
static boolean |
isTerminalRuleCall(org.eclipse.emf.ecore.EObject grammarElement) |
static boolean |
isUnassignedAction(org.eclipse.emf.ecore.EObject e) |
static boolean |
isUnassignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele) |
static boolean |
isUnassignedParserRuleCall(org.eclipse.emf.ecore.EObject ele) |
public static java.lang.String getClasspathRelativePathToXmi(Grammar grammar)
public static java.lang.String getClasspathRelativePathToBinGrammar(Grammar grammar)
public static java.lang.String getLanguageId(Grammar g)
public static java.lang.String getSimpleName(Grammar g)
@Deprecated public static java.lang.String getName(Grammar g)
getSimpleName(Grammar)
for more claritypublic static java.lang.String getNamespace(Grammar g)
public static Grammar getGrammar(org.eclipse.emf.ecore.EObject grammarElement)
public static AbstractRule containingRule(org.eclipse.emf.ecore.EObject e)
public static ParserRule containingParserRule(org.eclipse.emf.ecore.EObject e)
public static EnumRule containingEnumRule(org.eclipse.emf.ecore.EObject e)
public static Assignment containingAssignment(org.eclipse.emf.ecore.EObject e)
public static Group containingGroup(org.eclipse.emf.ecore.EObject e)
public static UnorderedGroup containingUnorderedGroup(org.eclipse.emf.ecore.EObject e)
public static CrossReference containingCrossReference(org.eclipse.emf.ecore.EObject e)
public static java.util.List<Action> containedActions(org.eclipse.emf.ecore.EObject e)
public static java.util.List<RuleCall> containedRuleCalls(org.eclipse.emf.ecore.EObject e)
public static java.util.List<Assignment> containedAssignments(org.eclipse.emf.ecore.EObject e)
public static java.util.List<Keyword> containedKeywords(org.eclipse.emf.ecore.EObject e)
public static java.util.List<AbstractElement> containedAbstractElements(org.eclipse.emf.ecore.EObject e)
public static java.util.List<CrossReference> containedCrossReferences(org.eclipse.emf.ecore.EObject e)
public static boolean containsAssignedAction(ParserRule rule)
public static java.util.List<AbstractElement> elementsBeforeThisInContainingGroup(AbstractElement _this)
public static boolean isParserRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
public static boolean isEObjectRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
public static boolean isEObjectRule(org.eclipse.emf.ecore.EObject grammarElement)
public static boolean isUnassignedParserRuleCall(org.eclipse.emf.ecore.EObject ele)
public static boolean isUnassignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele)
public static boolean isEObjectFragmentRuleCall(org.eclipse.emf.ecore.EObject ele)
public static boolean isEObjectFragmentRule(AbstractRule rule)
public static boolean isAssignedEObjectRuleCall(org.eclipse.emf.ecore.EObject ele)
public static boolean isDatatypeRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
public static boolean isEnumRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
public static boolean isTerminalRuleCall(org.eclipse.emf.ecore.EObject grammarElement)
public static AbstractRule findRuleForName(Grammar grammar, java.lang.String ruleName)
ruleName
- the name of the rule that should be found. May be a qualified name with a dot as a delimiter.public static java.util.List<AbstractRule> allRules(Grammar grammar)
public static java.util.List<ParserRule> allParserRules(Grammar _this)
public static java.util.List<TerminalRule> allTerminalRules(Grammar _this)
public static java.util.Collection<? extends AbstractElement> getAllAlternatives(Grammar g)
public static java.util.Collection<? extends AbstractElement> getAllGroups(Grammar g)
public static java.util.Collection<? extends AbstractElement> getAllUnorderedGroups(Grammar g)
public static java.util.Collection<? extends AbstractElement> getAllAssignments(Grammar g)
public static java.util.Collection<? extends AbstractElement> getAllPredicatedElements(Grammar g)
public static java.util.List<AbstractMetamodelDeclaration> allMetamodelDeclarations(Grammar grammar)
public static java.lang.String getTypeRefName(TypeRef typeRef)
public static boolean isAssigned(org.eclipse.emf.ecore.EObject e)
public static boolean isAssignedAction(org.eclipse.emf.ecore.EObject e)
public static boolean isUnassignedAction(org.eclipse.emf.ecore.EObject e)
public static java.util.Set<java.lang.String> getAllKeywords(Grammar g)
public static boolean isBooleanAssignment(Assignment a)
public static boolean isSingleAssignment(Assignment a)
public static boolean isMultipleAssignment(Assignment a)
public static boolean isMultipleAssignment(Action a)
public static boolean isOptionalCardinality(AbstractElement e)
public static boolean isMultipleCardinality(AbstractElement e)
public static boolean isOneOrMoreCardinality(AbstractElement e)
public static boolean isAnyCardinality(AbstractElement e)
public static boolean isDatatypeRule(ParserRule parserRule)
public static boolean isDatatypeRule(AbstractRule abstractRule)
public static org.eclipse.emf.ecore.EReference getReference(CrossReference ref, org.eclipse.emf.ecore.EClass referenceOwner)
public static org.eclipse.emf.ecore.EReference getReference(CrossReference crossRef)
public static org.eclipse.emf.ecore.EClassifier findCurrentType(AbstractElement element)
public static java.util.Collection<org.eclipse.emf.ecore.EPackage> allEPackagesToValidate(Grammar _this)
public static org.eclipse.emf.ecore.EDataType findEString(Grammar grammar)
public static org.eclipse.emf.ecore.EDataType findEBoolean(Grammar grammar)
public static org.eclipse.emf.ecore.EClass findEObject(Grammar grammar)