|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.nrl.parser.ast.impl.ModelReferenceHelper
public class ModelReferenceHelper
A helper class for resolving model references against a model. This class is mainly used by
AntlrModelResolver.
The job of the class is to navigate the model and resolve name strings to attributes or model elements.
| Constructor Summary | |
|---|---|
ModelReferenceHelper()
|
|
| Method Summary | |
|---|---|
static IModelElement |
getModelElement(String elementName,
ModelReferenceImpl ref,
IModelCollection models,
List<NRLError> errors)
Look up a model element by name, handling both absolute and qualified names. |
protected static void |
raiseError(List<NRLError> errors,
ModelReferenceImpl ref,
int statusCode,
String message)
Helper method to raise errors on model references more efficiently. |
static void |
resolveReference(ModelReferenceImpl ref,
IModelCollection models,
IModelElement contextElement,
IClassifier initialContext,
VariableContext variableContext,
Map<String,IVariableDeclaration> globalVariableContext,
List<NRLError> errors)
Resolve a reference by looking up the initial step and traversing a path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelReferenceHelper()
| Method Detail |
|---|
public static void resolveReference(ModelReferenceImpl ref,
IModelCollection models,
IModelElement contextElement,
IClassifier initialContext,
VariableContext variableContext,
Map<String,IVariableDeclaration> globalVariableContext,
List<NRLError> errors)
This implements a fall-back algorithm to find the initial step of the path and then resolve all further steps.
null and the
reference remains invalid.
ref - the reference to resolvemodels - the models to look up elements incontextElement - the "current" (nearest enclosing) context elementinitialContext - the overall rule/fragment contextvariableContext - a stack of IVariable objects, with variable declarations in
scopeerrors - a collection of semantic errors to add to if necessary
public static IModelElement getModelElement(String elementName,
ModelReferenceImpl ref,
IModelCollection models,
List<NRLError> errors)
elementName - the element nameref - the reference in which the name occurredmodels - the models to searcherrors - the error list to add to if an error occurs
protected static void raiseError(List<NRLError> errors,
ModelReferenceImpl ref,
int statusCode,
String message)
errors - statusCode - message -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||