Enum xswag_syntax_java::lex::Token [] [src]

pub enum Token {
    Whitespace,
    Comment,
    Ident(String),
    KeyW(Keyword),
    Literal(Lit),
    ParenOp,
    ParenCl,
    BraceOp,
    BraceCl,
    BracketOp,
    BracketCl,
    Semi,
    Comma,
    Dot,
    DotDotDot,
    At,
    ColonSep,
    Eq,
    Gt,
    Lt,
    Bang,
    Tilde,
    Question,
    Colon,
    Arrow,
    EqEq,
    Ge,
    Le,
    Ne,
    AndAnd,
    OrOr,
    PlusPlus,
    MinusMinus,
    Plus,
    Minus,
    Star,
    Slash,
    And,
    Or,
    Caret,
    Percent,
    Shl,
    Shr,
    ShrUn,
    PlusEq,
    MinusEq,
    StarEq,
    SlashEq,
    AndEq,
    OrEq,
    CaretEq,
    PercentEq,
    ShlEq,
    ShrEq,
    ShrUnEq,
}

A Java token

This enum differs a bit from the original definition in the Java spec, in which this Token is called InputElement and is defined as: WhiteSpace | Comment | Token The Java-*Token* is defined as: Identifier | Keyword | Literal | Seperator | Operator

This Token type differs from the formal and correct definition to make the parser and lexer module less verbose. The differences are: - all 5 variants of the Java-*Token* are direct variants of this Token - therefore the name Java-*Token* is not necessary and Java's InputElement is called Token instead - *Seperator*s and *Operator*s are also direct variants of this Token

Variants

Methods

impl Token
[src]

Returns true if the token is a "real" token (aka. a Java-*Token*)

String for error reporting. Example: Excpected one of `,` `;` `)`

Trait Implementations

impl Debug for Token
[src]

Formats the value using the given formatter.

impl Clone for Token
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Token
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Token
[src]

impl Display for Token
[src]

Formats the value using the given formatter. Read more