Click or drag to resize

DFA Class

A DFA implemented as a set of transition tables.
Inheritance Hierarchy
SystemObject
  Stimulsoft.Data.Expressions.Antlr.RuntimeDFA

Namespace:  Stimulsoft.Data.Expressions.Antlr.Runtime
Assembly:  Stimulsoft.Data (in Stimulsoft.Data.dll) Version: 2019.3.1.0
Syntax
public class DFA

The DFA type exposes the following members.

Constructors
  NameDescription
Public methodDFA
Initializes a new instance of the DFA class
Public methodDFA(SpecialStateTransitionHandler)
Initializes a new instance of the DFA class
Top
Properties
Methods
  NameDescription
Protected methodDebugRecognitionException
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodError
A hook for debugging interface
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodNoViableAlt
Public methodPredict
From the input stream, predict what alternative will succeed using this DFA (representing the covering regular approximation to the underlying CFL). Return an alternative number 1..n. Throw an exception upon error.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberUnpackEncodedString
Given a String that has a run-length-encoding of some unsigned shorts like "\1\2\3\9", convert to short[] {2,9,9,9}. We do this to avoid static short[] which generates so much init code that the class won't compile. :(
Public methodStatic memberUnpackEncodedStringToUnsignedChars
Hideous duplication of code, but I need different typed arrays out :(
Top
Fields
  NameDescription
Protected fieldaccept
Public fielddebug
Protected fielddecisionNumber
Protected fieldeof
Protected fieldeot
Protected fieldmax
Protected fieldmin
Protected fieldrecognizer
Which recognizer encloses this DFA? Needed to check backtracking
Protected fieldspecial
Protected fieldtransition
Top
Remarks
Any state that has a semantic predicate edge is special; those states are generated with if-then-else structures in a specialStateTransition() which is generated by cyclicDFA template. There are at most 32767 states (16-bit signed short). Could get away with byte sometimes but would have to generate different types and the simulation code too. For a point of reference, the Java lexer's Tokens rule DFA has 326 states roughly.
See Also