picasso.parser
Class Tokenizer
java.lang.Object
picasso.parser.Tokenizer
public class Tokenizer
- extends java.lang.Object
A tokenizer for the Picasso language.
- Author:
- Sara Sprenkle
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tokenizer
public Tokenizer()
getSemanticParser
public SemanticAnalyzer getSemanticParser()
parseTokens
public java.util.List<Token> parseTokens(java.lang.String s)
- Parses the given string into a list of Picasso tokens (in order)
- Parameters:
s
- the string to parse; may or may not be in valid format.
- Returns:
- the list of Picasso tokens (in order) in the string
getToken
public Token getToken()
- Returns:
- the currToken
setCurrToken
public void setCurrToken(Token currToken)
- Parameters:
currToken
- the currToken to set
match
public Token match(Token rhs)
- Try to match a token. If unsuccessful throw an exception. Otherwise match
succeeds, and next token is obtained and returned
- Parameters:
rhs
- token being matched
- Returns:
- the next read token
- Throws:
ParseException
- if match fails
main
public static void main(java.lang.String[] args)
- Parameters:
args
-