Package com.orange.wink.ast

Examples of com.orange.wink.ast.AstNode.asString()


        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();
View Full Code Here


    final AstNode c0 = childsCall.get(0);
    int type = c0.getType();

    if (type == Token.NAME) {
      namespace = new Namespace();
      namespace.addName(c0.asString());
    } else if (type == Token.GETPROP) {
      final Namespace ns = new GetProp(c0).resolveNamespace();
      namespace = new Namespace();
      namespace.appendNamespace(ns);
    } else if (type == Token.FUNCTION) {
View Full Code Here

      final AstNode ci = childsCall.get(i);
      type = ci.getType();

      if (type == Token.NAME || type == Token.STRING || type == Token.GETVAR || type == Token.NUMBER) {
        final Namespace ns = new Namespace();
        ns.addName(ci.asString());
        parameters.add(ns);
      } else if (type == Token.GETPROP) {
        final Namespace ns = new GetProp(ci).resolveNamespace();
        parameters.add(ns);
      } else {
View Full Code Here

    final List<AstNode> childsCall = callnode.getChilds();
    final AstNode c0 = childsCall.get(0);
    final int type = c0.getType();

    if (type == Token.NAME && Constants.DEFINE_CALL.equals(c0.asString())) {
      return new DefineCall(n);
    } else {
      return new Call(n);
    }
  }
View Full Code Here

      final int lt = left.getType();
      final int rt = right.getType();

      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 {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.