Package org.mozilla.javascript.ast

Examples of org.mozilla.javascript.ast.PropertyGet


    private String nameOf(final AstNode node) {
      if (node instanceof Name) {
        return ((Name) node).getIdentifier();
      }
      else if (node instanceof PropertyGet) {
        PropertyGet prop = (PropertyGet) node;
        return String.format("%s.%s", nameOf(prop.getTarget()), nameOf(prop.getProperty()));
      }
      else if (node instanceof StringLiteral) {
        return ((StringLiteral) node).getValue();
      }
      return null;
View Full Code Here


  @Override
  public AstNode property(AstNode target, CharSequence name) {
    if (target == null) {
      return name(name);
    }
    PropertyGet prop = new PropertyGet();
    prop.setTarget(target);
    prop.setProperty((Name) name(name));
    return prop;
  }
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.ast.PropertyGet

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.