public class DmdlSemantics extends Object
Constructor and Description |
---|
DmdlSemantics() |
Modifier and Type | Method and Description |
---|---|
ModelSymbol |
createModelSymbol(AstSimpleName modelName)
Creates and returns a new model symbol in this world.
|
ModelDeclaration |
declareModel(AstModelDefinition<?> modelOriginalAst,
AstSimpleName modelName,
AstDescription modelDescription,
List<? extends AstAttribute> modelAttributes)
Declares a new property into this model.
|
ModelDeclaration |
findModelDeclaration(String modelName)
Returns a declared model in this world.
|
Collection<ModelDeclaration> |
getDeclaredModels()
Returns all models declared in this world.
|
List<Diagnostic> |
getDiagnostics()
Returns the all diagnostics about semantics analysis.
|
boolean |
hasError()
Returns iff some error diagnostics have been reported.
|
void |
report(Diagnostic diagnostic)
Adds a diagnostic about semantics analysis.
|
void |
reportAll(Iterable<? extends Diagnostic> diagnosticList)
Adds diagnostics about semantics analysis.
|
public ModelDeclaration declareModel(AstModelDefinition<?> modelOriginalAst, AstSimpleName modelName, AstDescription modelDescription, List<? extends AstAttribute> modelAttributes)
modelOriginalAst
- the original AST, or null
if this is an ad-hoc elementmodelName
- the name of this modelmodelDescription
- the description of this model, or null
if unknownmodelAttributes
- the attributes of this modelIllegalArgumentException
- if some parameters were null
public ModelSymbol createModelSymbol(AstSimpleName modelName)
modelName
- the name of target modelIllegalArgumentException
- if some parameters were null
public ModelDeclaration findModelDeclaration(String modelName)
modelName
- the name of the modelnull
if not declaredIllegalArgumentException
- if some parameters were null
public Collection<ModelDeclaration> getDeclaredModels()
IllegalArgumentException
- if some parameters were null
public void reportAll(Iterable<? extends Diagnostic> diagnosticList)
diagnosticList
- diagnosticsIllegalArgumentException
- if some parameters were null
public void report(Diagnostic diagnostic)
diagnostic
- the diagnosticIllegalArgumentException
- if some parameters were null
public boolean hasError()
true
iff semantic analysis has errorpublic List<Diagnostic> getDiagnostics()
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.