Package com.orange.wink.exception

Examples of com.orange.wink.exception.WinkUnmanagedSyntaxException


      } else if (lt == Token.THIS) {
        name = Ast.tokenName(Token.THIS);
      } else if (lt == Token.GETPROP || lt == Token.GETELEM) {
        child = new GetProp(left);
      } else {
        throw new WinkUnmanagedSyntaxException("Unknow GetProp Syntax, unexpected: " + Ast.tokenName(lt) + "-" + Ast.tokenName(rt) + " " + Ast.getPositionInfo(n));
      }
      if (rt == Token.STRING || rt == Token.NAME || rt == Token.GETVAR || rt == Token.NUMBER) {
        prop = right.asString();
      } else if (rt == Token.SUB || rt == Token.ADD) {
        final List<AstNode> rightChilds = right.getChilds();
        final String sign = (rt == Token.SUB) ? "-" : "+";
        try {
          prop = rightChilds.get(0).asString() + sign + rightChilds.get(1).asString();
        } catch (final Exception e) {
          prop = Ast.tokenName(rt);
        }
      } else if (rt == Token.GETPROP || rt == Token.GETELEM) {
        prop = new GetProp(right).resolveNamespace().toString();
      } else {
        throw new WinkUnmanagedSyntaxException("Unknow GetProp Syntax, unexpected: " + Ast.tokenName(lt) + "-" + Ast.tokenName(rt) + " " + Ast.getPositionInfo(n));
      }
    } else {
      throw new WinkUnmanagedSyntaxException("Unknow GetProp Syntax, expected: 2 tokens" + " " + Ast.getPositionInfo(n));
    }
  }
View Full Code Here


    } else if (type == Token.FUNCTION) {
      function = new Function(c0);
      namespace = new Namespace();
      namespace.addName(function.getNode().getFunctionName());
    } else {
      throw new WinkUnmanagedSyntaxException("Unknow Call Syntax, unexpected(0): " + Ast.tokenName(type) + " " + Ast.getPositionInfo(n));
    }

    for (int i = 1; i < childsCall.size(); i++) {
      final AstNode ci = childsCall.get(i);
      type = ci.getType();
View Full Code Here

    } else if (leftType == Token.GETPROP) {
      namespace = new GetProp(left).resolveNamespace();
    } else if (leftType == Token.GETELEM) {
      namespace = new GetElem(left).resolveNamespace();
    } else {
      throw new WinkUnmanagedSyntaxException("Unknow SetProp Syntax, unexpected left token : " + Ast.tokenName(leftType) + " " + Ast.getPositionInfo(n));
    }

    if (midType == Token.STRING || midType == Token.NAME || midType == Token.GETVAR || midType == Token.NUMBER) {
      prop = mid.asString();
    } else {
      throw new WinkUnmanagedSyntaxException("Unknow SetProp Syntax, unexpected middle token : " + Ast.tokenName(midType) + " " + Ast.getPositionInfo(n));
    }

    value = ParserUtils.resolveParseObject(right);
  }
View Full Code Here

  public SetName(final AstNode n) throws WinkUnmanagedSyntaxException {
    super(n);

    final List<AstNode> childs = n.getChilds();
    if (childs.size() != 2) {
      throw new WinkUnmanagedSyntaxException("Unknow SetName Syntax : expected 2 tokens" + " " + Ast.getPositionInfo(n));
    }

    if (childs.get(0).getType() != Token.BINDNAME) {
      throw new WinkUnmanagedSyntaxException("Unknow SetName Syntax : expected Token." + Ast.tokenName(Token.BINDNAME) + " " + Ast.getPositionInfo(n));
    }
    bindName = childs.get(0).asString();
    value = ParserUtils.resolveParseObject(childs.get(1));
  }
View Full Code Here

      if (lt == Token.NAME && rt == Token.NAME) {
        name = left.asString();
        prop = right.asString();
      } else {
        final String syntax = "" + Ast.tokenName(Token.NAME) + "-" + Ast.tokenName(Token.NAME);
        throw new WinkUnmanagedSyntaxException("Unknow GetElem Syntax, expected: " + syntax + " -> " + Ast.tokenName(lt) + "-" + Ast.tokenName(rt) + " " + Ast.getPositionInfo(n));
      }
    } else {
      throw new WinkUnmanagedSyntaxException("Unknow GetElem Syntax, expected: 2 tokens" + " " + Ast.getPositionInfo(n));
    }
  }
View Full Code Here

TOP

Related Classes of com.orange.wink.exception.WinkUnmanagedSyntaxException

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.