sealed class
|
ParserContext
|
extends
|
Disposable
|
Has the end of the input token sequence been reached?
public
property
|
IsEof
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
there
are
no
more
input
tokens
following
the
current
position,
false
if
at
least
one
more
token
will
follow.
|
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Returns the current position.
public
property
|
Position
{
get
}
|
||
type
|
int32
|
||
value
|
|
The current position. |
Returns the number of remaining input tokens.
public
property
|
Remaining
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of remaining input tokens. |
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
public
method
|
Begin
()
|
public
method
|
Begin
(int32 astCommand)
|
||
params
|
astCommand
|
public
method
|
Commit
()
|
Consumes the next n input tokens and advances the position accordingly.
public
method
|
Consume
(int32 n = 1)
|
||
params
|
n
|
Number
of
input
tokens
to
consume.
Defaults
to
1 . |
public
method
|
CreateAst
(IGrammarRule rule)
|
||
type
|
AstNode
|
||
params
|
rule
|
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
public
method
|
GetParserErrors
()
|
||
type
|
ValidateResult
|
Peeks a token relative to the current position without modifying the current position.
public
method
|
Peek
(int32 offset = 0)
|
||
type
|
char
|
||
params
|
offset
|
The
relative
offset.
Defaults
to
0 . |
|
returns
|
The
token
or
'\0'
for
out-of-range
offsets. |
Remarks:
If the resulting token offset lies outside the valid range, the default value of the token type will be returned.
public
method
|
Rollback
()
|
Returns the position stack for the given rule.
public
method
|
RulePositionStack
(IRule rule)
|
||
type
|
ParserContextStack
|
||
params
|
rule
|
The rule object. | |
returns
|
|
The position stack. |
Skips subsequent input according to the skip rule of the current grammar of the top-most grammar rule.
public
method
|
Skip
()
|
||
type
|
bool
|
||
returns
|
true
if
at
least
one
input
character
has
been
skipped,
false
if
not.
|