ParserInput class

Input Management


ParserInput(String input, Contexts context)
Receives the input string and the environment information and reset pointers.


autoCommentAbsorb bool
If true, skipWhiteSpace store the comments for further conversion to Comment node
read / write
commentStore List<CommentPointer>
Store for comments found with skipWhiteSpace, waiting to be converted to Comment node if possible
read / write
context Contexts
Environment variables
read / write
finished bool
End of input reached in processing
read / write
furthest int
Furthest index the parser has gone to
read / write
furthestPossibleErrorMessage String
If this is furthest we got to, this is the probably cause
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
i int
Current index in input
read / write
input String
Input string with Less code
isEmpty bool
The input pointer is at end
isNotEmpty bool
The input pointer is not at end
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
saveStack List<int>
Holds state for backtracking
read / write


$char(String tok) String
Returns a String if tok character is found. [...]
$parseUntil({String tok, RegExp tokre}) List<ParseUntilReturnItem>
Permissive parsing. Ignores everything except matching {} [] () and quotes until matching token (outside of blocks) [...]
$quoted({bool skip: true}) String
Returns a quoted "..." or '...' string if found, else null. If skip == false, don't move the pointer (i) with skipWhitespace, so, point to the first "|' character.
$re(RegExp reg, [int index]) → dynamic
Specialization of $(tok). [...]
$reMatch(RegExp reg) Match
Returns the raw match for reg Regular Expression
$str(String tok) String
Returns tok if found at current position
charAt(int pos) String
Get the character in pos [...]
charCodeAt(int pos) int
Get the character code in the pos
charCodeAtPos() int
Get the character code in the actual position
currentChar() String
Get the character in the actual position
end() ParserStatus
Check if we are at the end of input. Returns the status.
error(String msg, [String type]) Null
Thow a error message
expect(dynamic arg, [String msg, int index]) → dynamic
Search for something and throw error if not found [...]
expectChar(String arg, [String msg]) String
Search for arg and returns it if found. Else throw error with the msg
forget() → void
Remove input pointer from stack
getInput() String
Returns the input String
isFinished() → void
If i is smaller than the input.length - 1, it means the parser wasn't able to parse the whole string, so we've got a parsing error. [...]
isWhitespace([int offset = 0]) bool
Char at pos + offset is 32 (space), 13 (CR), 9 (tab) or 10 (LF)
isWhitespacePos() bool
is white space in the actual position
isWhitespacePrevPos() bool
is White Space Previous Position
nextChar() String
Get the next character, from the actual position
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
peek(dynamic tok) bool
Same as $(), but don't change the state of the parser, just return the match. tok = String | RegExp
peekChar(String tok) bool
Specialization of peek(), searching for String tok
peekNotNumeric() bool
Test if current char is not a number
prevChar() String
Get the previous character, from the actual position
restore([String possibleErrorMessage]) → void
restore input pointers from stack
save() → void
save input pointers in stack
showAround([int gap = 20]) String
For debug, show the input around the currentChar +- gap
skipWhitespace(int newi) → void
Assure the input pointer is not a white space. Move forward if one is found.
toString() String
Returns a string representation of this object.


operator ==(Object other) bool
The equality operator. [...]