public class Context extends Object
Constructor and Description |
---|
Context(DmdlSemantics world,
Iterable<? extends TypeDriver> typeDrivers,
Iterable<? extends AttributeDriver> attributeDrivers)
Creates and returns a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
error(AstNode node,
String format,
Object... arguments)
Reports an error.
|
AttributeDriver |
findAttributeDriver(AstAttribute attribute)
Returns an attribute driver corresponding to the attribute.
|
DmdlSemantics |
getWorld()
Returns the root semantics model of current context.
|
boolean |
hasError()
Returns whether or not there are any errors in this context.
|
Type |
resolveType(AstType type)
Returns the corresponded type of the type syntax.
|
public Context(DmdlSemantics world, Iterable<? extends TypeDriver> typeDrivers, Iterable<? extends AttributeDriver> attributeDrivers)
world
- the world objecttypeDrivers
- type resolversattributeDrivers
- attributed analyzersIllegalArgumentException
- if some parameters were null
public DmdlSemantics getWorld()
public void error(AstNode node, String format, Object... arguments)
node
- the related AST nodeformat
- the message formatarguments
- the message argumentspublic boolean hasError()
true
if there are some errors, otherwise false
public Type resolveType(AstType type)
type
- the type syntaxnull
if cannot resolveIllegalArgumentException
- if some parameters were null
public AttributeDriver findAttributeDriver(AstAttribute attribute)
attribute
- the attribute to find a corresponded drivernull
if does not existIllegalArgumentException
- if some parameters were null
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.