Class MmuTreeWalkerBase.CommonBuilder
- java.lang.Object
-
- ru.ispras.microtesk.mmu.translator.MmuTreeWalkerBase.CommonBuilder
-
- Enclosing class:
- MmuTreeWalkerBase
protected final class MmuTreeWalkerBase.CommonBuilder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(org.antlr.runtime.tree.CommonTree attrId, java.util.List<Stmt> stmts)
void
addVariable(org.antlr.runtime.tree.CommonTree varId, org.antlr.runtime.tree.CommonTree typeId)
void
addVariable(org.antlr.runtime.tree.CommonTree varId, ru.ispras.fortress.expression.Node sizeExpr)
Memory
buildMemory()
Segment
buildSegment(ru.ispras.fortress.expression.Node rangeStartExpr, ru.ispras.fortress.expression.Node rangeEndExpr)
Creates a segment IR object and adds it to the MMU IR.
-
-
-
Method Detail
-
addVariable
public void addVariable(org.antlr.runtime.tree.CommonTree varId, ru.ispras.fortress.expression.Node sizeExpr) throws SemanticException
- Throws:
SemanticException
-
addVariable
public void addVariable(org.antlr.runtime.tree.CommonTree varId, org.antlr.runtime.tree.CommonTree typeId) throws SemanticException
- Throws:
SemanticException
-
addAttribute
public void addAttribute(org.antlr.runtime.tree.CommonTree attrId, java.util.List<Stmt> stmts) throws SemanticException
- Throws:
SemanticException
-
buildMemory
public Memory buildMemory() throws SemanticException
- Throws:
SemanticException
-
buildSegment
public Segment buildSegment(ru.ispras.fortress.expression.Node rangeStartExpr, ru.ispras.fortress.expression.Node rangeEndExpr) throws SemanticException
Creates a segment IR object and adds it to the MMU IR.- Parameters:
rangeStartExpr
- Range start expression.rangeEndExpr
- Range and expression.- Returns:
- New Segment IR object.
- Throws:
SemanticException
- (1) if the specified address type is not defined; (2) if the range expressions equal tonull
, (3) if the range expressions cannot be reduced to constant integer values; (4) if the range start value is greater than the range end value.
-
-