new Lit( [literal])
Creates a literal symbol for EBNF;
see factory method grammar.lit().
Sets .expect to contain this.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
literal |
string |
<optional> |
a (quoted) representation for the literal. |
- Mixes In:
- Source:
Properties:
| Name | Type | Argument | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
expect |
module:EBNF~Set | set of terminals which a node
expects to see as |
|||||||||||||
follow |
module:EBNF~Set |
<nullable> |
see |
||||||||||||
name |
string | representation for a literal.
Empty string is reserved for |
|||||||||||||
used |
boolean | true if used in a grammar. |
|||||||||||||
prec |
Object | precedence, only for translation to BNF. Properties
|
|||||||||||||
value |
string | (unquoted) value for the literal; empty string for |
|||||||||||||
screened |
boolean |
<optional> |
set true only during scanner construction if literal value matches a token pattern. |
Extends
Methods
-
dump()
-
Displays description and precedence, if any.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string
-
toString()
-
Displays representation of a literal or
$eof.- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string
-
unescape(s)
-
Removes leading and trailing delimiter character and elaboarates backslash escapes.
Parameters:
Name Type Description sstring string to unescape.
- Inherited From:
- Overrides:
- Source:
Returns:
unquoted, unescaped string.
- Type
- string