Class StreamTokenizerSettings
This contains the settings that control the behavior of the tokenizer. This is separated from the StreamTokenizer so that common settings are easy to package and keep together.
Inherited Members
Namespace: RTools_NTS.Util
Assembly: NetTopologySuite.dll
Syntax
public class StreamTokenizerSettings
Constructors
| Edit this page View SourceStreamTokenizerSettings()
Default constructor.
Declaration
public StreamTokenizerSettings()
StreamTokenizerSettings(StreamTokenizerSettings)
Copy constructor.
Declaration
public StreamTokenizerSettings(StreamTokenizerSettings other)
Parameters
Type | Name | Description |
---|---|---|
StreamTokenizerSettings | other |
Properties
| Edit this page View SourceCharTypes
This is the character type table. Each byte is bitwise encoded with the character attributes, such as whether that character is word or whitespace.
Declaration
public byte[] CharTypes { get; }
Property Value
Type | Description |
---|---|
byte[] |
DoUntermCheck
Whether or not to check for unterminated quotes and block comments. If true, and one is encoutered, an exception is thrown of the appropriate type.
Declaration
public bool DoUntermCheck { get; set; }
Property Value
Type | Description |
---|---|
bool |
GrabComments
Whether or not to return comments.
Declaration
public bool GrabComments { get; set; }
Property Value
Type | Description |
---|---|
bool |
GrabEol
Whether or not to return EolTokens on end of line. Eol tokens will not break up other tokens which can be multi-line. For example block comments and quotes will not be broken by Eol tokens. Therefore the number of Eol tokens does not give you the line count of a stream.
Declaration
public bool GrabEol { get; set; }
Property Value
Type | Description |
---|---|
bool |
GrabWhitespace
Whether or not to return whitespace tokens. If not, they're ignored.
Declaration
public bool GrabWhitespace { get; set; }
Property Value
Type | Description |
---|---|
bool |
ParseHexNumbers
Whether or not to parse Hex (0xABCD...) numbers. This setting is based on the character types table, so this setting interacts with character type table manipulation.
Declaration
public bool ParseHexNumbers { get; set; }
Property Value
Type | Description |
---|---|
bool |
ParseNumbers
Whether or not digits are specified as Digit type in the character table. This setting is based on the character types table, so this setting interacts with character type table manipulation. This setting may become incorrect if you modify the character types table directly.
Declaration
public bool ParseNumbers { get; set; }
Property Value
Type | Description |
---|---|
bool |
SlashSlashComments
Whether or not to look for // comments
Declaration
public bool SlashSlashComments { get; set; }
Property Value
Type | Description |
---|---|
bool |
SlashStarComments
Whether or not to look for /* */ block comments.
Declaration
public bool SlashStarComments { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceCharTypeToString(byte)
Return a string representation of a character type setting. Since the type setting is bitwise encoded, a character can have more than one type.
Declaration
public string CharTypeToString(byte ctype)
Parameters
Type | Name | Description |
---|---|---|
byte | ctype | The character type byte. |
Returns
Type | Description |
---|---|
string | The string representation of the type flags. |
CommentChar(int)
Specify that a particular character is a comment-starting character. Character table type manipulation method.
Declaration
public void CommentChar(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c |
Copy(StreamTokenizerSettings)
Sets this object to be the same as the specified object. Note that some settings which are entirely embodied by the character type table.
Declaration
public void Copy(StreamTokenizerSettings other)
Parameters
Type | Name | Description |
---|---|---|
StreamTokenizerSettings | other |
Display()
Display the state of this object.
Declaration
public void Display()
Display(string)
Display the state of this object, with a per-line prefix.
Declaration
public void Display(string prefix)
Parameters
Type | Name | Description |
---|---|---|
string | prefix | The pre-line prefix. |
IsCharType(byte, CharTypeBits)
Check whether the specified char type byte has a particular type flag set.
Declaration
public bool IsCharType(byte ctype, CharTypeBits type)
Parameters
Type | Name | Description |
---|---|---|
byte | ctype | The char type byte. |
CharTypeBits | type | The CharTypeBits entry to compare to. |
Returns
Type | Description |
---|---|
bool | bool - true or false |
IsCharType(char, CharTypeBits)
Check whether the specified char has a particular type flag set.
Declaration
public bool IsCharType(char c, CharTypeBits type)
Parameters
Type | Name | Description |
---|---|---|
char | c | The character. |
CharTypeBits | type | The CharTypeBits entry to compare to. |
Returns
Type | Description |
---|---|
bool | bool - true or false |
IsCharType(int, CharTypeBits)
Check whether the specified char has a particular type flag set.
Declaration
public bool IsCharType(int c, CharTypeBits type)
Parameters
Type | Name | Description |
---|---|---|
int | c | The character. |
CharTypeBits | type | The CharTypeBits entry to compare to. |
Returns
Type | Description |
---|---|
bool | bool - true or false |
OrdinaryChar(int)
Remove other type settings from a character. Character table type manipulation method.
Declaration
public void OrdinaryChar(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c |
OrdinaryChars(int, int)
Remove other type settings from a range of characters. Character table type manipulation method.
Declaration
public void OrdinaryChars(int startChar, int endChar)
Parameters
Type | Name | Description |
---|---|---|
int | startChar | |
int | endChar |
QuoteChar(int)
Specify that a particular character is a quote character. Character table type manipulation method.
Declaration
public void QuoteChar(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c |
ResetCharTypeTable()
Clear the character type settings. This leaves them unset, as opposed to the default. Use SetDefaults() for default settings.
Declaration
public void ResetCharTypeTable()
SetDefaults()
Setup default parse behavior. This resets to same behavior as on construction.
Declaration
public bool SetDefaults()
Returns
Type | Description |
---|---|
bool | bool - true for success. |
SetupForCodeParse()
Apply settings which are commonly used for code parsing C-endCapStyle code, including C++, C#, and Java.
Declaration
public bool SetupForCodeParse()
Returns
Type | Description |
---|---|
bool |
WhitespaceChar(int)
Specify that a character is a whitespace character. Character table type manipulation method. This type is exclusive with other types.
Declaration
public void WhitespaceChar(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c | The character. |
WhitespaceChars(int, int)
Specify that a range of characters are whitespace characters. Character table type manipulation method. This adds the characteristic to the char(s), rather than overwriting other characteristics.
Declaration
public void WhitespaceChars(int startChar, int endChar)
Parameters
Type | Name | Description |
---|---|---|
int | startChar | First character. |
int | endChar | Last character. |
WordChar(int)
Specify that a particular character is a word character. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types.
Declaration
public void WordChar(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c | The character. |
WordChars(int, int)
Specify that a range of characters are word characters. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types.
Declaration
public void WordChars(int startChar, int endChar)
Parameters
Type | Name | Description |
---|---|---|
int | startChar | First character. |
int | endChar | Last character. |
WordChars(string)
Specify that a string of characters are word characters. Character table type manipulation method. This adds the type to the char(s), rather than overwriting other types.
Declaration
public void WordChars(string s)
Parameters
Type | Name | Description |
---|---|---|
string | s |