Package com.stuffwithstuff.bantam

Examples of com.stuffwithstuff.bantam.ParseException


*/
public class AssignParselet implements InfixParselet {
  public Expression parse(Parser parser, Expression left, Token token) {
    Expression right = parser.parseExpression(Precedence.ASSIGNMENT - 1);
   
    if (!(left instanceof NameExpression)) throw new ParseException(
        "The left-hand side of an assignment must be a name.");
   
    String name = ((NameExpression)left).getName();
    return new AssignExpression(name, right);
  }
View Full Code Here

TOP

Related Classes of com.stuffwithstuff.bantam.ParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.