Class

org.apache.daffodil.grammar

Gram

Related Doc: package grammar

Permalink

abstract class Gram extends OOLAGHostImpl with BasicComponent with GramRuntime1Mixin

Gram - short for "Grammar Term"

These are the objects in the grammar.

This grammar really differs a great deal from what we find in the DFDL specification because it actually has to be operationalized.

Many of the grammar productions really aren't terribly grammar-like in appearance, because the conditional logic overwhelms the aspects that look like grammar productions.

Another way to think of this as it's just the "second tree". Daffodil starts by creating the DSOM "first tree" which is just the AST (Abstract Syntax Tree) of the DFDL language. Then by way of compiling creates this Gram tree from that which enables a variety of optimizations based on a simple rules-with-guards idiom.

This Gram tree is then a generator of a Parser and an Unparser which incorporate both the parsing/unparsing logic and all RuntimeData structures in their members. If something completely optimizes out then it becomes the EmptyGram which other Gram combinators recognize and optimize out.

Linear Supertypes
GramRuntime1Mixin, BasicComponent, ImplementsThrowsOrSavesSDE, SavesErrorsAndWarnings, ImplementsThrowsSDE, ResolvesQNames, ThrowsSDE, HasTunable, OOLAGHostImpl, OOLAGHost, NamedMixinBase, WithDiagnostics, Logging, Identity, AnyRef, Any
Known Subclasses
AlignmentFill, AssertBase, AssertBooleanPrim, AssertBooleanPrimBase, AssertPatternPrim, AssertPatternPrimBase, BCDDecimalDelimited, BCDDecimalDelimitedEndOfData, BCDDecimalKnownLength, BCDDecimalPrefixedLength, BCDDecimalRuntimeLength, BCDIntegerDelimited, BCDIntegerDelimitedEndOfData, BCDIntegerKnownLength, BCDIntegerPrefixedLength, BCDIntegerRuntimeLength, BinaryBoolean, BinaryBooleanPrefixedLength, BinaryDecimalKnownLength, BinaryDecimalPrefixedLength, BinaryDecimalRuntimeLength, BinaryDouble, BinaryFloat, BinaryGram, BinaryIntegerKnownLength, BinaryIntegerPrefixedLength, BinaryIntegerRuntimeLength, BlobSpecifiedLength, CaptureContentLengthEnd, CaptureContentLengthStart, CaptureValueLengthEnd, CaptureValueLengthStart, ChoiceCombinator, ComplexNilOrContent, ConvertBinaryDateTimeSecMilliPrim, ConvertCalendarPrimBase, ConvertTextBooleanPrim, ConvertTextBytePrim, ConvertTextCalendarPrimBase, ConvertTextCombinator, ConvertTextDatePrim, ConvertTextDateTimePrim, ConvertTextDecimalPrim, ConvertTextDoublePrim, ConvertTextFloatPrim, ConvertTextIntPrim, ConvertTextIntegerPrim, ConvertTextLongPrim, ConvertTextNonNegativeIntegerPrim, ConvertTextNumberPrim, ConvertTextShortPrim, ConvertTextTimePrim, ConvertTextUnsignedBytePrim, ConvertTextUnsignedIntPrim, ConvertTextUnsignedLongPrim, ConvertTextUnsignedShortPrim, ConvertZonedBytePrim, ConvertZonedCombinator, ConvertZonedDecimalPrim, ConvertZonedIntPrim, ConvertZonedIntegerPrim, ConvertZonedLongPrim, ConvertZonedNonNegativeIntegerPrim, ConvertZonedNumberPrim, ConvertZonedShortPrim, ConvertZonedUnsignedBytePrim, ConvertZonedUnsignedIntPrim, ConvertZonedUnsignedLongPrim, ConvertZonedUnsignedShortPrim, DelimiterStackCombinatorChoice, DelimiterStackCombinatorElement, DelimiterStackCombinatorSequence, DelimiterText, DiscriminatorBooleanPrim, DiscriminatorPatternPrim, DynamicEscapeSchemeCombinatorElement, ElementCombinator, ElementCombinatorBase, ElementParseAndUnspecifiedLength, ElementUnused, EmptyGram, ExpressionEvaluatorBase, HexBinaryDelimited, HexBinaryDelimitedEndOfData, HexBinaryEndOfBitLimit, HexBinaryLengthPrefixed, HexBinarySpecifiedLength, IBM4690PackedDecimalDelimited, IBM4690PackedDecimalDelimitedEndOfData, IBM4690PackedDecimalKnownLength, IBM4690PackedDecimalPrefixedLength, IBM4690PackedDecimalRuntimeLength, IBM4690PackedIntegerDelimited, IBM4690PackedIntegerDelimitedEndOfData, IBM4690PackedIntegerKnownLength, IBM4690PackedIntegerPrefixedLength, IBM4690PackedIntegerRuntimeLength, InitiatedContent, Initiator, InputValueCalc, LayeredSequence, LeadingSkipRegion, LeftCenteredPadding, LiteralCharacterNilOfSpecifiedLength, LiteralNilDelimitedEndOfData, LiteralValueNilOfSpecifiedLength, LogicalNilValue, MandatoryTextAlignment, NamedGram, NewVariableInstanceBase, NewVariableInstanceEnd, NewVariableInstanceStart, OnlyPadding, OrderedSequence, PackedDecimalDelimited, PackedDecimalDelimitedEndOfData, PackedDecimalKnownLength, PackedDecimalPrefixedLength, PackedDecimalRuntimeLength, PackedIntegerDelimited, PackedIntegerDelimitedEndOfData, PackedIntegerKnownLength, PackedIntegerPrefixedLength, PackedIntegerRuntimeLength, Primitive, Prod, RepElementSequenceChild, RepOrderedExactlyNSequenceChild, RepOrderedExpressionOccursCountSequenceChild, RepOrderedWithMinMaxSequenceChild, RightCenteredPadding, RightFill, ScalarOrderedSequenceChild, SeqComp, SequenceChild, SequenceCombinator, SequenceSeparator, SetVariable, SimpleNilOrValue, SimpleTypeRetry, SkipRegion, SpecifiedLengthCombinatorBase, SpecifiedLengthExplicit, SpecifiedLengthExplicitCharacters, SpecifiedLengthImplicit, SpecifiedLengthImplicitCharacters, SpecifiedLengthPattern, SpecifiedLengthPrefixed, SpecifiedLengthPrefixedCharacters, StaticText, StringDelimBase, StringDelimited, StringDelimitedEndOfData, StringOfSpecifiedLength, Terminal, Terminator, Text, TrailingSkipRegion, TypeValueCalc, UnicodeByteOrderMark, UnimplementedPrimitive, UnorderedSequence, ValueCalcBase
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gram
  2. GramRuntime1Mixin
  3. BasicComponent
  4. ImplementsThrowsOrSavesSDE
  5. SavesErrorsAndWarnings
  6. ImplementsThrowsSDE
  7. ResolvesQNames
  8. ThrowsSDE
  9. HasTunable
  10. OOLAGHostImpl
  11. OOLAGHost
  12. NamedMixinBase
  13. WithDiagnostics
  14. Logging
  15. Identity
  16. AnyRef
  17. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Gram(contextArg: SchemaComponent)

    Permalink

Abstract Value Members

  1. abstract def parser: Parser

    Permalink

    Provides parser.

    Provides parser.

    Required to examine child parsers, and optimize itself out by propagating NadaParser if there is no parser.

    Definition Classes
    GramRuntime1Mixin
  2. abstract def unparser: Unparser

    Permalink

    Provides unparser.

    Provides unparser.

    Required to examine child unparsers, and optimize itself out by propagating NadaUnparser if there is no unparser.

    Definition Classes
    GramRuntime1Mixin

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def LV[T](sym: Symbol)(body: ⇒ T): OOLAGValue[T]

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  5. def NoAnnotationContext: Option[SchemaFileLocation]

    Permalink
    Definition Classes
    ImplementsThrowsSDE
  6. final def SDE(str: String, args: Any*): Nothing

    Permalink
    Definition Classes
    Gram → SavesErrorsAndWarnings → ImplementsThrowsSDE → ThrowsSDE
  7. final def SDE(th: Throwable): Nothing

    Permalink
    Definition Classes
    ThrowsSDE
  8. def SDEButContinue(id: String, args: Any*): Unit

    Permalink
    Definition Classes
    ImplementsThrowsOrSavesSDE → SavesErrorsAndWarnings
  9. final def SDW(warnID: WarnID, str: String, args: Any*): Unit

    Permalink
    Definition Classes
    Gram → ImplementsThrowsOrSavesSDE → SavesErrorsAndWarnings
  10. def ThrowSDE: PartialFunction[Throwable, Nothing]

    Permalink
    Definition Classes
    ThrowsSDE
  11. final def areLogging(lvl: Type): Boolean

    Permalink
    Definition Classes
    Logging
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. final def assuming(pred: Boolean): Unit

    Permalink
    Definition Classes
    OOLAGHost
  14. final def checkErrors: Unit

    Permalink
    Definition Classes
    OOLAGHost
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. final val context: SchemaComponent

    Permalink
  17. final var currentOVList: Seq[OOLAGValueBase]

    Permalink
    Definition Classes
    OOLAGHost
  18. lazy val diagnosticDebugName: String

    Permalink
    Definition Classes
    NamedMixinBase
  19. def diagnostics: Seq[Diagnostic]

    Permalink
    Definition Classes
    OOLAGHost
  20. def doLogging(lvl: Type, msg: String, args: Seq[Any]): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  23. def error(th: Diagnostic): Unit

    Permalink
    Definition Classes
    OOLAGHost
  24. final def errors: Seq[Diagnostic]

    Permalink
    Definition Classes
    OOLAGHost
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. val forWhat: ParserOrUnparser

    Permalink
  27. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  28. def getDiagnostics: Seq[Diagnostic]

    Permalink
    Definition Classes
    OOLAGHost → WithDiagnostics
  29. def getLogWriter(): LogWriter

    Permalink
    Definition Classes
    Logging
  30. final def getLoggingLevel(): Type

    Permalink
    Definition Classes
    Logging
  31. final def hasNoParser: Parser

    Permalink
    Attributes
    protected
    Definition Classes
    GramRuntime1Mixin
  32. final def hasNoUnparser: Unparser

    Permalink
    Attributes
    protected
    Definition Classes
    GramRuntime1Mixin
  33. final def hasOOLAGRootSetup: Boolean

    Permalink
    Definition Classes
    OOLAGHost
  34. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  35. def isEmpty: Boolean

    Permalink
  36. def isError: Boolean

    Permalink
    Definition Classes
    OOLAGHost → WithDiagnostics
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. final macro def log(lvl: Type, msg: String, args: Any*): Unit

    Permalink
    Definition Classes
    Logging
  39. lazy val logID: String

    Permalink
    Definition Classes
    Logging → Identity
  40. var logLevel: Maybe[Type]

    Permalink
    Definition Classes
    Logging
  41. var logWriter: Maybe[LogWriter]

    Permalink
    Definition Classes
    Logging
  42. final def maybeParser: Maybe[Parser]

    Permalink
    Definition Classes
    GramRuntime1Mixin
  43. final lazy val maybeUnparser: Maybe[Unparser]

    Permalink
    Definition Classes
    GramRuntime1Mixin
  44. final val nArgs: Args

    Permalink
    Definition Classes
    OOLAGHostImpl → OOLAGHost
  45. def name: String

    Permalink
  46. final def namespaces: NamespaceBinding

    Permalink
    Definition Classes
    Gram → ResolvesQNames
  47. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  48. final def notYetImplemented(msg: String, args: Any*): Nothing

    Permalink
    Definition Classes
    ThrowsSDE
  49. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  51. final lazy val oolagContext: OOLAGHost

    Permalink
    Definition Classes
    OOLAGHost
  52. final def oolagContextViaArgs: Option[OOLAGHost]

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHostImpl → OOLAGHost
  53. def oolagError(th: Diagnostic): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  54. final def oolagParent: OOLAGHost

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  55. def oolagWarn(th: Diagnostic): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  56. final lazy val optOolagContext: Option[OOLAGHost]

    Permalink
    Definition Classes
    OOLAGHost
  57. lazy val path: String

    Permalink
    Definition Classes
    Gram → OOLAGHost
  58. def qNameForProperty(local: String, ns: NS): GlobalQName

    Permalink
    Definition Classes
    ResolvesQNames
  59. def removePrefix(prefixedValue: String): String

    Permalink
    Definition Classes
    ResolvesQNames
  60. final def requiredEvaluations(lv: OOLAGValueBase): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  61. final def requiredEvaluations(arg: ⇒ Any): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    OOLAGHost
  62. def resolveQName(qnString: String): RefQName

    Permalink
    Definition Classes
    ResolvesQNames
  63. final def schemaDefinitionError(str: String, args: Any*): Nothing

    Permalink
    Definition Classes
    ThrowsSDE
  64. def schemaDefinitionErrorButContinue(str: String, args: Any*): Unit

    Permalink
    Definition Classes
    SavesErrorsAndWarnings
  65. def schemaDefinitionErrorDueToPropertyValue(propertyName: String, propertyValue: String, propertyLocation: LookupLocation, otherPropertyLocation: LookupLocation, str: String, args: Any*): Nothing

    Permalink
    Definition Classes
    SavesErrorsAndWarnings
  66. final macro def schemaDefinitionUnless(testThatWillThrowIfFalse: Boolean, str: String, args: Any*): Unit

    Permalink
    Definition Classes
    ThrowsSDE
  67. macro def schemaDefinitionWarningUnless(warnID: WarnID, testThatWillWarnIfFalse: Boolean, str: String, args: Any*): Unit

    Permalink
    Definition Classes
    SavesErrorsAndWarnings
  68. macro def schemaDefinitionWarningWhen(warnID: WarnID, testThatWillWarnIfTrue: Boolean, str: String, args: Any*): Unit

    Permalink
    Definition Classes
    SavesErrorsAndWarnings
  69. final macro def schemaDefinitionWhen(testThatWillThrowIfTrue: Boolean, str: String, args: Any*): Unit

    Permalink
    Definition Classes
    ThrowsSDE
  70. final def schemaFileLocation: SchemaFileLocation

    Permalink
    Definition Classes
    Gram → ThrowsSDE
  71. def setLogWriter(lw: LogWriter): Unit

    Permalink
    Definition Classes
    Logging
  72. def setLoggingLevel(level: Type): Unit

    Permalink
    Definition Classes
    Logging
  73. final def setOOLAGContext(oolagContextArg: OOLAGHost): Unit

    Permalink
    Definition Classes
    OOLAGHost
  74. def subset(testThatWillThrowIfFalse: Boolean, msg: String, args: Any*): Unit

    Permalink
    Definition Classes
    ImplementsThrowsOrSavesSDE
  75. def subsetError(msg: String, args: Any*): Nothing

    Permalink
    Definition Classes
    ImplementsThrowsOrSavesSDE
  76. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  77. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  78. final def toss(th: Throwable): Nothing

    Permalink
    Definition Classes
    ThrowsSDE
  79. final lazy val tunable: DaffodilTunables

    Permalink
    Definition Classes
    Gram → ImplementsThrowsOrSavesSDE → HasTunable
  80. final def unqualifiedPathStepPolicy: UnqualifiedPathStepPolicy

    Permalink
    Definition Classes
    Gram → ResolvesQNames
  81. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  82. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  83. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  84. def warn(th: Diagnostic): Unit

    Permalink
    Definition Classes
    OOLAGHost
  85. final def warnings: Seq[Diagnostic]

    Permalink
    Definition Classes
    OOLAGHost
  86. macro def withLoggingLevel[S](newLevel: Type)(body: ⇒ S): Unit

    Permalink
    Definition Classes
    Logging
  87. def ||(qq: ⇒ Gram): Gram

    Permalink

    This || operator means one of the operands ONLY.

    This || operator means one of the operands ONLY. I.e., statically they are supposed to be mutually exclusive, so only one (or none) of them should ever survive.

  88. def ~(qq: ⇒ Gram): Gram

    Permalink

    Sequential composition operator in the grammar.

    Sequential composition operator in the grammar.

    Note: This should not evaluate the argument unless it has to.

Inherited from GramRuntime1Mixin

Inherited from BasicComponent

Inherited from ImplementsThrowsOrSavesSDE

Inherited from SavesErrorsAndWarnings

Inherited from ImplementsThrowsSDE

Inherited from ResolvesQNames

Inherited from ThrowsSDE

Inherited from HasTunable

Inherited from OOLAGHostImpl

Inherited from OOLAGHost

Inherited from NamedMixinBase

Inherited from WithDiagnostics

Inherited from Logging

Inherited from Identity

Inherited from AnyRef

Inherited from Any

Ungrouped