![]() |
BadScript 2
|
Implements the Source Code Reader. More...
Public Member Functions | |
| BadSourceReader (string fileName, string source, int start, int end) | |
| Creates a new Source Code Reader. | |
| BadSourceReader (string fileName, string source) | |
| Creates a new Source Code Reader. | |
| void | SetPosition (int index) |
| Sets the Current Index of the Reader. | |
| bool | IsEof (int offset=0) |
| Returns true if the reader is at the end of the source code. | |
| BadSourcePosition | MakeSourcePosition (int length) |
| Creates a source position with the specified length and the current index of the reader. | |
| BadSourcePosition | MakeSourcePosition (int index, int length) |
| Creates a source position with the specified length and index. | |
| char | GetCurrentChar (int offset=0) |
| Returns the Current Character. | |
| void | MoveNext () |
| Moves the Reader to the next character in the source code. | |
| bool | Is (char c, int offset=0) |
| Returns true if the current character matches the specified character. | |
| bool | Is (string s, int offset=0) |
| Returns true if the string matches the specified character. | |
| bool | Is (params char[] chars) |
| Returns true if any of the characters match the specified character. | |
| bool | Is (params string[] s) |
| Returns true if any of the strings match the specified character. | |
| bool | Is (int offset, params char[] chars) |
| Returns true if any of the characters match the specified character. | |
| bool | Is (int offset, params string[] s) |
| Returns true if any of the strings match the specified String. | |
| BadSourcePosition | Eat (char c) |
| Asserts that the current character matches the specified character. | |
| BadSourcePosition | Eat (params char[] c) |
| Asserts that the current character matches one of the specified characters. | |
| BadSourcePosition | Eat (string s) |
| Asserts that the current String matches the specified String. | |
| BadSourcePosition | Eat (params string[] s) |
| Asserts that the current string matches one of the specified strings. | |
| void | Seek (char c) |
| Skips over any character that is not equal to the specified character. | |
| void | Seek (string s) |
| Skips over any string that is not equal to the specified string. | |
| void | Seek (params char[] c) |
| Skips over any character that is not equal to any of the specified characters. | |
| void | Seek (params string[] s) |
| Skips over any character that is not equal to any of the specified strings. | |
| void | Skip (char c) |
| If the current character is equal to the specified character, it will be skipped. | |
| void | Skip (params char[] c) |
| If the current character is equal to any of the specified characters, it will be skipped. | |
Static Public Member Functions | |
| static BadSourceReader | FromFile (string fileName) |
| Creates a new Source Code Reader from a File. | |
Properties | |
| string | Preview [get] |
| Preview of the Source Code. | |
| string | Source [get] |
| The Source Code. | |
| string | FileName [get] |
| The Filename of the Source Code. | |
| int | CurrentIndex [get, private set] |
| The Current Index of the Reader. | |
| char | CurrentChar [get] |
| The Current Character of the Reader. | |
Private Attributes | |
| readonly int | m_EndIndex |
| readonly string | m_Source |
| The Source Code. | |
| readonly int | m_StartIndex |
| Start Index of the Source Code. | |
Implements the Source Code Reader.
Definition at line 12 of file BadSourceReader.cs.
| BadScript2.Reader.BadSourceReader.BadSourceReader | ( | string | fileName, |
| string | source, | ||
| int | start, | ||
| int | end | ||
| ) |
Creates a new Source Code Reader.
| fileName | Filename of the Source Code |
| source | The Source Code |
| start | The Start Index of the Source Code |
| end | The End Index of the Source Code |
| ArgumentOutOfRangeException | Gets raised if the start or end index is invalid. |
Definition at line 35 of file BadSourceReader.cs.
| BadScript2.Reader.BadSourceReader.BadSourceReader | ( | string | fileName, |
| string | source | ||
| ) |
Creates a new Source Code Reader.
| fileName | The Filename of the Source Code |
| source | The Source Code |
Definition at line 60 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.Eat | ( | char | c | ) |
Asserts that the current character matches the specified character.
| c | The Character to be matched |
| BadSourceReaderException | Gets raised if the character does not match the specified one |
Definition at line 234 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.Eat | ( | params char[] | c | ) |
Asserts that the current character matches one of the specified characters.
| c | The Characters to be matched |
| BadSourceReaderException | Gets raised if the character does not match any of the specified ones |
Definition at line 255 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.Eat | ( | params string[] | s | ) |
Asserts that the current string matches one of the specified strings.
| s | The strings to be matched |
| BadSourceReaderException | Gets raised if the string does not match any of the specified ones |
Definition at line 302 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.Eat | ( | string | s | ) |
Asserts that the current String matches the specified String.
| s | The String to be matched |
| BadSourceReaderException | Gets raised if the String does not match the specified one |
Definition at line 276 of file BadSourceReader.cs.
|
static |
Creates a new Source Code Reader from a File.
| fileName | The File Name |
Definition at line 101 of file BadSourceReader.cs.
| char BadScript2.Reader.BadSourceReader.GetCurrentChar | ( | int | offset = 0 | ) |
Returns the Current Character.
| offset | The Offset from the Current Reader Position |
Definition at line 142 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | char | c, |
| int | offset = 0 |
||
| ) |
Returns true if the current character matches the specified character.
| c | The Character to be matched. |
| offset | The Offset from the Current Reader Position |
Definition at line 161 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | int | offset, |
| params char[] | chars | ||
| ) |
Returns true if any of the characters match the specified character.
| offset | The Offset from the Current Reader Position |
| chars | The Characters to be matched. |
Definition at line 211 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | int | offset, |
| params string[] | s | ||
| ) |
Returns true if any of the strings match the specified String.
| offset | The Offset from the Current Reader Position |
| s | The strings to be matched. |
Definition at line 222 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | params char[] | chars | ) |
Returns true if any of the characters match the specified character.
| chars | The Characters to be matched. |
Definition at line 190 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | params string[] | s | ) |
Returns true if any of the strings match the specified character.
| s | The strings to be matched. |
Definition at line 200 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.Is | ( | string | s, |
| int | offset = 0 |
||
| ) |
Returns true if the string matches the specified character.
| s | The Character to be matched. |
| offset | The Offset from the Current Reader Position |
Definition at line 172 of file BadSourceReader.cs.
| bool BadScript2.Reader.BadSourceReader.IsEof | ( | int | offset = 0 | ) |
Returns true if the reader is at the end of the source code.
| offset | The Offset from the Current Reader Position |
Definition at line 111 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.MakeSourcePosition | ( | int | index, |
| int | length | ||
| ) |
Creates a source position with the specified length and index.
| index | The Start index |
| length | The Length of the Position |
Definition at line 132 of file BadSourceReader.cs.
| BadSourcePosition BadScript2.Reader.BadSourceReader.MakeSourcePosition | ( | int | length | ) |
Creates a source position with the specified length and the current index of the reader.
| length | The Length of the Position |
Definition at line 121 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.MoveNext | ( | ) |
Moves the Reader to the next character in the source code.
Definition at line 150 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Seek | ( | char | c | ) |
Skips over any character that is not equal to the specified character.
| c | The character to be matched. |
Definition at line 321 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Seek | ( | params char[] | c | ) |
Skips over any character that is not equal to any of the specified characters.
| c | The characters to be matched. |
Definition at line 345 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Seek | ( | params string[] | s | ) |
Skips over any character that is not equal to any of the specified strings.
| s | The strings to be matched. |
Definition at line 357 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Seek | ( | string | s | ) |
Skips over any string that is not equal to the specified string.
| s | The string to be matched. |
Definition at line 333 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.SetPosition | ( | int | index | ) |
Sets the Current Index of the Reader.
| index | The new Index |
Definition at line 91 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Skip | ( | char | c | ) |
If the current character is equal to the specified character, it will be skipped.
| c | The character to be matched. |
Definition at line 369 of file BadSourceReader.cs.
| void BadScript2.Reader.BadSourceReader.Skip | ( | params char[] | c | ) |
If the current character is equal to any of the specified characters, it will be skipped.
| c | The characters to be matched. |
Definition at line 381 of file BadSourceReader.cs.
|
private |
Definition at line 14 of file BadSourceReader.cs.
|
private |
The Source Code.
Definition at line 19 of file BadSourceReader.cs.
|
private |
Start Index of the Source Code.
Definition at line 24 of file BadSourceReader.cs.
|
get |
The Current Character of the Reader.
Definition at line 85 of file BadSourceReader.cs.
|
getprivate set |
The Current Index of the Reader.
Definition at line 80 of file BadSourceReader.cs.
|
get |
|
get |
Preview of the Source Code.
Definition at line 65 of file BadSourceReader.cs.
|
get |
The Source Code.
Definition at line 70 of file BadSourceReader.cs.