Package org.renjin.compiler.ir.exception

Examples of org.renjin.compiler.ir.exception.InvalidSyntaxException


      return (Symbol) argument;
    } else if(argument.length() == 1 && argument instanceof StringVector) {
      StringVector vector = (StringVector)argument;
      return Symbol.get(vector.getElementAsString(0));
    } else {
      throw new InvalidSyntaxException("Illegal index value: " + argument);
    }
  }
View Full Code Here


  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {

    if(!(context instanceof LoopContext)) {
      throw new InvalidSyntaxException("`next` cannot be used outside of a loop");
    }
    LoopContext loopContext = (LoopContext)context;
    builder.addStatement( new GotoStatement(loopContext.getStartLabel()));
  }
View Full Code Here

  @Override
  public void addStatement(IRBodyBuilder builder, TranslationContext context,
      FunctionCall call) {

    if(!(context instanceof LoopContext)) {
      throw new InvalidSyntaxException("`break` cannot be used outside of a loop");
    }
    LoopContext loopContext = (LoopContext)context;
    builder.addStatement( new GotoStatement(loopContext.getExitLabel()));
  }
View Full Code Here

  @Override
  public Expression translateToExpression(IRBodyBuilder builder,
      TranslationContext context, FunctionCall call) {
    SEXP argument = call.getArgument(0);
    if(!(argument instanceof FunctionCall)) {
      throw new InvalidSyntaxException(".Internal() expects a language object as its only argument");
    }
    FunctionCall primitiveCall = (FunctionCall) argument;

    return builder.translatePrimitiveCall(context, primitiveCall);
  }
View Full Code Here

    if( lhs instanceof Symbol) {
      target = (Symbol) lhs;
    } else if(lhs instanceof StringVector) {
      target = Symbol.get(((StringVector) lhs).getElementAsString(0));
    } else {
      throw new InvalidSyntaxException("cannot assign to value '" + lhs + " (of type " + lhs.getTypeName() + ")");
    }

    // make the final assignment to the target symbol
    if(rhs instanceof Promise) {
      rhs = rhs.force(context);
View Full Code Here

TOP

Related Classes of org.renjin.compiler.ir.exception.InvalidSyntaxException

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.