Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Irony.Parsing.ISourceStream Interface Reference

Interface for Terminals to access the source stream and produce tokens. More...

Inheritance diagram for Irony.Parsing.ISourceStream:
Irony.Parsing.SourceStream

Public Member Functions

Token CreateToken (Terminal terminal)
 Creates a new token based on current preview position. More...
 
Token CreateToken (Terminal terminal, object value)
 Creates a new token based on current preview position and sets its Value field. More...
 
Token CreateErrorToken (string message, params object[] args)
 Creates error token with custom error message as its Value. More...
 
bool MatchSymbol (string symbol, bool ignoreCase)
 Tries to match the symbol with the text at current preview position. More...
 
bool EOF ()
 

Properties

string Text [get]
 Returns the source text More...
 
SourceLocation Location [get, set]
 Current start location (position, row, column) of the new token More...
 
int PreviewPosition [get, set]
 Gets or sets the current preview position in the source file. Must be greater or equal to Location.Position More...
 
char PreviewChar [get]
 Gets a char at preview position More...
 
char NextPreviewChar [get]
 Gets the char at position next after the PrevewPosition More...
 
int TabWidth [get, set]
 

Detailed Description

Interface for Terminals to access the source stream and produce tokens.

Definition at line 23 of file _ISourceStream.cs.

Member Function Documentation

Token Irony.Parsing.ISourceStream.CreateErrorToken ( string  message,
params object[]  args 
)

Creates error token with custom error message as its Value.

Parameters
messageMessage template, can contain placeholder like {0} to be filled by values from args.
argsA list of message arguments
Returns
An error token.

Implemented in Irony.Parsing.SourceStream.

Referenced by Irony.Parsing.RegExLiteral.TryMatch().

Token Irony.Parsing.ISourceStream.CreateToken ( Terminal  terminal)

Creates a new token based on current preview position.

Parameters
terminalA terminal associated with the token.
Returns
New token.

Implemented in Irony.Parsing.SourceStream.

Token Irony.Parsing.ISourceStream.CreateToken ( Terminal  terminal,
object  value 
)

Creates a new token based on current preview position and sets its Value field.

Parameters
terminalA terminal associated with the token.
valueThe value associated with the token.
Returns
New token.

Implemented in Irony.Parsing.SourceStream.

bool Irony.Parsing.ISourceStream.EOF ( )
bool Irony.Parsing.ISourceStream.MatchSymbol ( string  symbol,
bool  ignoreCase 
)

Tries to match the symbol with the text at current preview position.

Parameters
symbolA symbol to match
ignoreCaseTrue if char casing should be ignored.
Returns
True if there is a match; otherwise, false.

Implemented in Irony.Parsing.SourceStream.

Referenced by Irony.Parsing.QuotedValueLiteral.ReadBody(), Irony.Parsing.WikiTagTerminal.TryMatch(), Irony.Parsing.WikiBlockTerminal.TryMatch(), and Irony.Parsing.KeyTerm.TryMatch().

Property Documentation

SourceLocation Irony.Parsing.ISourceStream.Location
getset

Current start location (position, row, column) of the new token

Definition at line 32 of file _ISourceStream.cs.

Referenced by Irony.Parsing.WikiTextTerminal.TryMatch().

char Irony.Parsing.ISourceStream.NextPreviewChar
get

Gets the char at position next after the PrevewPosition

Definition at line 45 of file _ISourceStream.cs.

int Irony.Parsing.ISourceStream.PreviewPosition
getset

Gets or sets the current preview position in the source file. Must be greater or equal to Location.Position

Definition at line 37 of file _ISourceStream.cs.

Referenced by Irony.Parsing.IdentifierTerminal.ReadBody(), and Irony.Parsing.RegexBasedTerminal.TryMatch().

int Irony.Parsing.ISourceStream.TabWidth
getset

Definition at line 78 of file _ISourceStream.cs.

string Irony.Parsing.ISourceStream.Text
get

Returns the source text

Definition at line 28 of file _ISourceStream.cs.


The documentation for this interface was generated from the following file: