Class MmuTreeWalkerBase.StructBuilder
- java.lang.Object
-
- ru.ispras.microtesk.mmu.translator.MmuTreeWalkerBase.StructBuilder
-
- Enclosing class:
- MmuTreeWalkerBase
protected final class MmuTreeWalkerBase.StructBuilder extends java.lang.Object
Builder for a Type. Helps create a complex type from a sequence of fields.
-
-
Constructor Summary
Constructors Constructor Description StructBuilder(java.lang.String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(org.antlr.runtime.tree.CommonTree fieldId, org.antlr.runtime.tree.CommonTree typeId)
void
addField(org.antlr.runtime.tree.CommonTree fieldId, ru.ispras.fortress.expression.Node sizeExpr, ru.ispras.fortress.expression.Node valueExpr)
Adds a field to Type to be created.Type
build()
Builds a Type from the collection of fields.
-
-
-
Method Detail
-
addField
public void addField(org.antlr.runtime.tree.CommonTree fieldId, ru.ispras.fortress.expression.Node sizeExpr, ru.ispras.fortress.expression.Node valueExpr) throws SemanticException
Adds a field to Type to be created.- Parameters:
fieldId
- Field identifier.sizeExpr
- Field size expression.valueExpr
- Field default value expression (optional, can benull
).- Throws:
SemanticException
- (1) if the size expression isnull
, (2) if the size expression cannot be evaluated to a positive integer value (Java int).
-
addField
public void addField(org.antlr.runtime.tree.CommonTree fieldId, org.antlr.runtime.tree.CommonTree typeId) throws SemanticException
- Throws:
SemanticException
-
build
public Type build()
Builds a Type from the collection of fields.- Returns:
- New Type.
-
-