org.snapscript.parse.Symbol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.parse;
public enum Symbol {
IDENTIFIER(TokenType.IDENTIFIER, "identifier") {
@Override
public boolean read(TokenReader reader) {
return reader.identifier();
}
},
TYPE(TokenType.TYPE, "type") {
@Override
public boolean read(TokenReader reader) {
return reader.type();
}
},
QUALIFIER(TokenType.QUALIFIER, "qualifier") {
@Override
public boolean read(TokenReader reader) {
return reader.qualifier();
}
},
HEXIDECIMAL(TokenType.HEXIDECIMAL, "hexidecimal") {
@Override
public boolean read(TokenReader reader) {
return reader.hexidecimal();
}
},
BINARY(TokenType.BINARY, "binary") {
@Override
public boolean read(TokenReader reader) {
return reader.binary();
}
},
DECIMAL(TokenType.DECIMAL, "decimal") {
@Override
public boolean read(TokenReader reader) {
return reader.decimal();
}
},
TEXT(TokenType.TEXT, "text") {
@Override
public boolean read(TokenReader reader) {
return reader.text();
}
},
TEMPLATE(TokenType.TEMPLATE, "template") {
@Override
public boolean read(TokenReader reader) {
return reader.template();
}
};
public final TokenType type;
public final String name;
private Symbol(TokenType type, String name) {
this.type = type;
this.name = name;
}
public abstract boolean read(TokenReader builder);
}