Package etch.compiler

Examples of etch.compiler.ParseException


    if (hasExtends())
    {
      Named<?> n = parent().get( xtnds.name );

      if (n == null)
        throw new ParseException( String.format(
          "exception %s extends %s not defined at line %d",
          this.name(), xtnds.name(), xtnds.token.beginLine ) );
     
      if (!(n instanceof Except))
        throw new ParseException( String.format(
          "exception %s extends %s not an exception at line %d",
          this.name(), xtnds.name(), xtnds.token.beginLine ) );
     
      Except s = this;
      while (s != null && s.hasExtends())
      {
        s = s.getExtends();
        if (s == this)
          throw new ParseException( String.format(
            "exception %s extends %s creates loop at line %d",
            this.name(), xtnds.name(), xtnds.token.beginLine ) );
      }
     
      s = getExtends();
      for (Parameter p: this)
      {
        Parameter x = s.getParameter( p.name().name );
        if (x != null)
          throw new ParseException( String.format(
            "exception %s extends %s hides parameter %s from %s at line %d",
            this.name(), xtnds.name(), x.name(), x.parent().name(),
            xtnds.token.beginLine ) );
      }
    }
View Full Code Here


   * @throws ParseException
   */
  public void check( Name name ) throws ParseException
  {
    if (map.containsKey( name.name ))
      throw new ParseException( String.format(
        "duplicate name (%s) at line %d", name.name, name.token.beginLine ) );
  }
View Full Code Here

TOP

Related Classes of etch.compiler.ParseException

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.