Package com.orange.wink.parse.objects

Source Code of com.orange.wink.parse.objects.DefineCall

/*--------------------------------------------------------
* Copyright (c) 2011, The Dojo Foundation
* This software is distributed under the "Simplified BSD license",
* the text of which is available at http://www.winktoolkit.org/licence.txt
* or see the "license.txt" file for more details.
*--------------------------------------------------------*/

/**
*
*/
package com.orange.wink.parse.objects;

import java.util.List;

import org.mozilla.javascript.Token;

import com.orange.wink.ast.AstNode;
import com.orange.wink.exception.WinkUnmanagedSyntaxException;
import com.orange.wink.model.Namespace;
import com.orange.wink.util.Common;

/**
* @author Sylvain Lalande
*
*/
public class DefineCall extends Call {
  /**
   * @param n
   * @throws WinkUnmanagedSyntaxException
   */
  public DefineCall(final AstNode n) throws WinkUnmanagedSyntaxException {
    super(n);

    parameters = Common.newArrayList(0);

    final AstNode callnode = n;
    final List<AstNode> childsCall = callnode.getChilds();

    for (int i = 0; i < childsCall.size(); i++) {
      final AstNode ci = childsCall.get(i);
      final int type = ci.getType();

      if (type == Token.FUNCTION) {
        function = new Function(ci);
        namespace = new Namespace();
        namespace.addName(function.getNode().getFunctionName());
      }
    }
  }
}
TOP

Related Classes of com.orange.wink.parse.objects.DefineCall

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.