Class Lex
Represents Lexical Analyzer Object
Defined in: lex04.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Lex(src)
Lexical Analyzer Object
|
Method Attributes | Method Name and Description |
---|---|
beforeDelim(delim)
Analyze text before given delimiter
|
|
ch(ch)
Given Character
|
|
digit()
Analyze Digit
|
|
lower()
Analyze Lower Case Character
|
|
sp()
Analyze Space
|
|
sq()
Analyze Single Quote
|
|
text(text, ignoreCase)
Analyze Text
|
|
top()
Return top one character on the pointer of the buffer
Caution: This method doesn't update buffer pointer. |
|
upper()
Analyze Upper Case Character
|
Class Detail
Lex(src)
Lexical Analyzer Object
- Parameters:
- {String} src
- source string to analyze
- Since:
- 0.1
Method Detail
{String}
beforeDelim(delim)
Analyze text before given delimiter
- Parameters:
- {String} delim
- delimiters such as ",;"
- Since:
- 0.4
- Returns:
- {String} text before given delimiters
{String}
ch(ch)
Given Character
- Parameters:
- {Char} ch
- given character
- Since:
- 0.2
- Returns:
- {String} character if matched, null if not matched
{String}
digit()
Analyze Digit
- Since:
- 0.2
- Returns:
- {String} digit if matched, null if not matched
{String}
lower()
Analyze Lower Case Character
- Since:
- 0.2
- Returns:
- {String} character if matched, null if not matched
{String}
sp()
Analyze Space
- Since:
- 0.2
- Returns:
- {String} space if matched, null if not matched
{String}
sq()
Analyze Single Quote
- Since:
- 0.2
- Returns:
- {String} single quote if matched, null if not matched
{String}
text(text, ignoreCase)
Analyze Text
- Parameters:
- {Boolean} text
- given text
- {Boolean} ignoreCase
- true if ignore case
- Since:
- 0.3
- Returns:
- {String} text if matched, null if not matched
{String}
top()
Return top one character on the pointer of the buffer
Caution: This method doesn't update buffer pointer.
Caution: This method doesn't update buffer pointer.
- Since:
- 0.4
- Returns:
- {String} character on the pointer of the buffer
{String}
upper()
Analyze Upper Case Character
- Since:
- 0.2
- Returns:
- {String} character if matched, null if not matched