Package com.orange.wink.parse.objects

Examples of com.orange.wink.parse.objects.ParseObject$LineComparator


   * @param sn
   * @throws WinkParseException
   */
  protected void interpretSetName(final SetName sn) throws WinkParseException {
    final String name = sn.getBindName();
    final ParseObject value = sn.getValue();
    final ScriptObject so = ParserUtils.buildScriptObject(value, this);
    final Namespace ns = Namespace.build(namespace, name);
    addComponent(name, so, this, ns);

    so.interpret();
View Full Code Here


   * @param silent
   * @return
   * @throws WinkUnmanagedSyntaxException
   */
  public static ParseObject resolveParseObject(final AstNode n, final boolean silent) throws WinkUnmanagedSyntaxException {
    ParseObject result = null;
    final int type = n.getType();

    try {
      if (type == Token.SETPROP || type == Token.SETELEM && SetProp.isValidSetProp(n)) {
        if (type == Token.SETPROP) {
          result = new SetProp(n);
        } else if (type == Token.SETELEM) {
          result = new SetElem(n);
        }
      } else if (type == Token.SETNAME) {
        result = new SetName(n);
      } else if (type == Token.OBJECTLIT) {
        result = new ObjectLit(n);
      } else if (type == Token.FUNCTION) {
        result = new Function(n);
      } else if (type == Token.CALL && Call.isValidCall(n)) {
        result = Call.getAppropriateCall(n);
      } else if (type == Token.EXPR_RESULT && ExprResultCall.isValidCall(n)) {
        result = new ExprResultCall(n);
      } else {
        result = new ParseObject(n);
      }
    } catch (final WinkUnmanagedSyntaxException e) {
      if (silent) {
        result = new ParseObject(n);
      } else {
        if (Constants.failOnUnmanagedSyntax) {
          throw e;
        } else if (Constants.warnOnUnmanagedSyntax) {
          System.err.println(e.getMessage());
          result = new ParseObject(n);
        }
      }
    }

    return result;
View Full Code Here

   * @param n
   * @param result
   * @throws WinkParseException
   */
  public static void getSetProp(final AstNode n, final List<SetProp> result) throws WinkParseException {
    final ParseObject po = ParserUtils.resolveParseObject(n);

    if (po instanceof SetProp) {
      final SetProp setp = (SetProp) po;
      result.add(setp);
    } else if (po instanceof Function) {
View Full Code Here

   * @param n
   * @param result
   * @throws WinkParseException
   */
  public static void getSetName(final AstNode n, final List<SetName> result) throws WinkParseException {
    final ParseObject po = ParserUtils.resolveParseObject(n);

    if (po instanceof SetName) {
      final SetName setn = (SetName) po;
      result.add(setn);
    } else if (po instanceof Function) {
View Full Code Here

   * @param n
   * @param result
   * @throws WinkParseException
   */
  public static void getCalls(final AstNode n, final List<Call> result) throws WinkParseException {
    final ParseObject po = ParserUtils.resolveParseObject(n, true);
    if (po instanceof Call) {
      final Call call = (Call) po;
      result.add(call);
    } else if (po instanceof Function) {
      return;
View Full Code Here

   * @param n
   * @param result
   * @throws WinkParseException
   */
  public static void getFunctions(final AstNode n, final List<Function> result) throws WinkParseException {
    final ParseObject po = ParserUtils.resolveParseObject(n);

    if (po instanceof SetName || po instanceof SetProp || po instanceof ObjectLit) {
      return;
    } else if (po instanceof Function) {
      final Function func = (Function) po;
View Full Code Here

   * @param n
   * @param result
   * @throws WinkParseException
   */
  public static void getExprResultCall(final AstNode n, final List<ExprResultCall> result) throws WinkParseException {
    final ParseObject po = ParserUtils.resolveParseObject(n);

    if (po instanceof ExprResultCall) {
      final ExprResultCall c = (ExprResultCall) po;
      result.add(c);
    } else if (po instanceof Function) {
View Full Code Here

    final List<AstNode> childs = node.getChilds();

    int index = 0;
    for (final String pName : objectIds) {
      final AstNode c = childs.get(index++);
      final ParseObject po = ParserUtils.resolveParseObject(c);
      final ScriptObject soc = ParserUtils.buildScriptObject(po, this);
      final Namespace nsc = Namespace.build(getNamespace(), pName);
      addComponent(pName, soc, this, nsc);
    }
  }
View Full Code Here

TOP

Related Classes of com.orange.wink.parse.objects.ParseObject$LineComparator

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.