|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.sc3d.apt.sss.v3.Escape
public class Escape
Represents an escape sequence in a literal string or literal character. This is not a subclass of Token, because escape sequences are simply incorporated into the surrounding Token. This class exists only as a way of sharing the code that lexes escape sequences.
| Field Summary | |
|---|---|
boolean |
isOkay
'true' if this Escape represents a syntactically correct escape sequence, otherwise 'false'. |
int |
length
The number of characters that make up this Escape. |
Sentence |
sentence
The Sentence in which this Escape was found. |
int |
start
The index of the character in 'sentence' at which this Escape starts. |
int |
value
The character code represented by this Escape. |
| Constructor Summary | |
|---|---|
Escape(Sentence sentence,
int start,
int length,
int value,
boolean isOkay)
Constructs an Escape given values for its fields. |
|
| Method Summary | |
|---|---|
static Escape |
lex(Sentence sentence,
int start)
Lexes an Escape in the middle of 'sentence' starting at 'start'. |
static void |
main(java.lang.String[] args)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final Sentence sentence
public final int start
public final int length
public final int value
public final boolean isOkay
| Constructor Detail |
|---|
public Escape(Sentence sentence,
int start,
int length,
int value,
boolean isOkay)
| Method Detail |
|---|
public static Escape lex(Sentence sentence,
int start)
sentence - the Sentence from which to pluck an Escape.start - the index of the initial '\' character of the escape sequence.
java.lang.IllegalArgumentException - if 'start' is not the index of a '\' character.public java.lang.String toString()
toString in class java.lang.Objectpublic static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||