|
Grammatica 1.3 Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
System.Object
|
+--LookAheadSet.Sequence
in LookAheadSet.csA token sequence. This class contains a list of token ids. It is immutable after creation, meaning that no changes will be made to an instance after creation.
Constructor Summary | |
Sequence()
Creates a new empty token sequence. |
|
Sequence( bool repeat, int token )
Creates a new token sequence with a single token. |
|
Sequence( int length, Sequence seq )
Creates a new token sequence that is a duplicate of another sequence. |
|
Sequence( bool repeat, Sequence seq )
Creates a new token sequence that is a duplicate of another sequence. |
Method Summary | |
Sequence |
Concat( int length, Sequence seq )
Creates a new token sequence that is the concatenation of this sequence and another. |
override bool |
Equals( object obj )
Checks if this sequence is equal to another object. |
bool |
Equals( Sequence seq )
Checks if this sequence is equal to another sequence. |
object |
GetToken( int pos )
Returns a token at a specified position in the sequence. |
bool |
IsNext( Parser parser )
Checks if the next token(s) in the parser matches this token sequence. |
bool |
IsNext( Parser parser, int length )
Checks if the next token(s) in the parser matches this token sequence. |
bool |
IsRepetitive()
Checks if this token sequence is repetitive. |
int |
Length()
Returns the length of the token sequence. |
bool |
StartsWith( Sequence seq )
Checks if this token sequence starts with the tokens from another sequence. |
Sequence |
Subsequence( int start )
Creates a new token sequence that is a subsequence of this one. |
override string |
ToString()
Returns a string representation of this object. |
string |
ToString( Tokenizer tokenizer )
Returns a string representation of this object. |
Constructor Detail |
public Sequence();
public Sequence( bool repeat, int token );
repeat
- the repeat flag value
token
- the token to addpublic Sequence( int length, Sequence seq );
length
- the maximum number of tokens to copy
seq
- the sequence to copypublic Sequence( bool repeat, Sequence seq );
repeat
- the new repeat flag value
seq
- the sequence to copyMethod Detail |
public Sequence Concat( int length, Sequence seq );
length
- the maximum length of the result
seq
- the other sequencepublic override bool Equals( object obj );
obj
- the object to compare withpublic bool Equals( Sequence seq );
seq
- the sequence to compare withpublic object GetToken( int pos );
pos
- the sequence positionpublic bool IsNext( Parser parser );
parser
- the parser to checkpublic bool IsNext( Parser parser, int length );
parser
- the parser to check
length
- the maximum number of tokens to checkpublic bool IsRepetitive();
public int Length();
public bool StartsWith( Sequence seq );
seq
- the token sequence to checkpublic Sequence Subsequence( int start );
start
- the subsequence start positionpublic override string ToString();
public string ToString( Tokenizer tokenizer );
tokenizer
- the tokenizer containing the tokens
|
Grammatica 1.3 Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |