FirstFollow class
The FirstFollow default analyzer for a given productions map
Constructors
- FirstFollow()
- Default constructor for the first and follow analyzer, it initializes all required fields with empty maps
Properties
-
allProducers
→ Map<
String, SymbolSet> -
Holds information about which each productions produces.
final
- firstList → ProductionTerminals
-
A Map containing the list of first terminals for each production
final
- followList → ProductionTerminals
-
A Map containing the list of follow terminals for each production
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
ProductionsMap productions, [String startSymbol = '']) → FirstFollowResult - With a given ProductionsMap and startSymbol, the algorithm starts to calculate the first and follow sets
-
firstOf(
String productionName, ProductionsMap allProductions, ProductionTerminals firstList) → SymbolSet -
Recursive function that receives a productions map and generates
the first set for each production
inherited
-
followOf(
String productionName, ProductionsMap allProductions, {required ProductionTerminals followList, required SymbolSet hasToo, required ProductionTerminals firstList, required Map< String, SymbolSet> allProducers}) → SymbolSet -
Recursive function that receives a productions map and generates
the follow set for each production
inherited
-
getAheadSymbol(
String lookingFor, List< Token> searchIn) → int -
returns the position of a symbol in ahead
inherited
-
getFirst(
String production, ProductionTerminals firstList) → SymbolSet -
Returns the first-set of a given production
inherited
-
isProduction(
String toTest) → bool -
Check whether a string represents a production
<PRODUCTION>
or notinherited -
itProduces(
String parentProduction, SubProductionsList subProductions) → void - Method to identify who produce every production in list
-
joinSets(
Set< String> main, Set<String> secondary) → Set<String> -
Takes two Set objects and return the concatenation of both,
disregarding the empty values using the
method
AbstractAnalyzer.valueIsEmpty
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceQuote(
String original, [int desiredCharacter = CHAR_SINGLE_QUOTE]) → String -
Takes a quoted or unquoted string and replaces the quotes with the given
desired rune.
inherited
-
sanitizeTerminal(
String original) → String -
Must return a string with single quote
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
valueIsEmpty(
String toTest) → bool -
Checks if the character has an empty value.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited