Package anvil

Examples of anvil.Location


  }     


  public TryStatement replaceWithTry()
  {
    Location location = getLocation();
    TryStatement trystmt = new TryStatement(this, location);
    ImplicitBlockStatement block = new ImplicitBlockStatement(trystmt, location);
    trystmt.setChildStatement(block);
    int n = _statements.size();
    for(int i=0; i<n; i++) {
View Full Code Here


    while(i < _statements.size()) {
      Statement stmt = (Statement)_statements.get(i);
      if (i+1 < _statements.size() && stmt.hasStaticContent()) {
        Statement next = (Statement)_statements.get(i+1);
        if (next.hasStaticContent()) {
          Location location = stmt.getLocation();
          buffer.setLength(0);
          buffer.append(stmt.getStaticContent());
          buffer.append(next.getStaticContent());
          _statements.remove(i);
          _statements.remove(i);
View Full Code Here

  }
 

  public Expression createInitializer()
  {
    Location location = _expression.getLocation();
    AssignmentNode assignment = new AssignmentNode(location, 2);
    assignment.setChild(0, new MemberVariableNode(_classtype, _classtype, this));
    assignment.setChild(1, _expression.getChild());
    return new Expression(assignment, location);
  }
View Full Code Here


  public void parse(TemplateParser parser, Tag tag)
  {
    super.parse(parser, tag);
    Location location = getLocation();
    boolean init = true;
    String s = tag.get("name");
    if (s == null) {
      parser.error(location, "Required class attribute 'name' is missing");
      init = false;
View Full Code Here

      onConst(parser, tag);
      break;

    case ST_FUNCTION:
      {
        Location location = parser.getLocation();
        String name = tag.get("name");
        if (name == null) {
          parser.error(location, "Required attribute 'name' missing from function definition");
        } else {
          name = name.trim();
View Full Code Here

  }
 

  public Expression createStaticInitializer()
  {
    Location location = _expression.getLocation();
    AssignmentNode assignment = new AssignmentNode(location, 2);
    assignment.setChild(0,new ConstantVariableNode(this));
    assignment.setChild(1, new ConstantNode(getValue()));
    return new Expression(assignment, location);
  }
View Full Code Here

  }


  public Expression createInitializer()
  {
    Location location = _expression.getLocation();
    AssignmentNode assignment = new AssignmentNode(location, 2);
    assignment.setChild(0, new ConstantVariableNode(this));
    assignment.setChild(1, _expression.getChild());
    return new Expression(assignment, location);
  }
View Full Code Here

    if (exception instanceof ForgingException) {
      ErrorListener listener = ((ForgingException)exception).getErrorListener();
      Enumeration e = listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
       
        out.print(
          "        <tr bgcolor=\"#f0f0ff\">\n" +
          "          <td><code><strong>");
         
        if (loc != null) {
          out.print("<a href=\"");
          String url = (loc.getURL() != null) ? loc.getURL().toString() : "";
          out.print(url);
          out.print("\">");
          out.print(url);
          out.print("</a>");
        } else {
          out.println("Unknown location");
        }

        out.print(
          "<strong></code></td>" +
          "          <td><code><strong>");

        if (loc != null) {
          int line = loc.getLine();
          if (line > 0) {
            out.print(line);
          } else {
            out.print("&nbsp;");
          }
        } else {
          out.print("&nbsp;");
        }

        out.print(
          "</strong></code></td>\n" +
          "          <td><code><strong>");

        if (loc != null) {
          int column = loc.getColumn();
          if (column > 0) {
            out.print(column);
          } else {
            out.print("&nbsp;");
          }
View Full Code Here

  /* exceptions */

 
  public final Location getCurrentLocation()
  {
    return new Location(address().getURL(), _frame.getLine(), 0);
  }
View Full Code Here


  public void parse(TemplateParser parser, Tag tag)
  {
    Parent parameters;
    Location location = getLocation();
  
    String params = tag.getValue("params");
    if (params != null) {
      ExpressionParser p = new ExpressionParser(parser, parser.getLocation(), params);
      parameters = p.parseParameterList();
View Full Code Here

TOP

Related Classes of anvil.Location

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.