Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StructBuilder

        public StructBuilder​(java.lang.String id)
    • 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 be null).
        Throws:
        SemanticException - (1) if the size expression is null, (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.