Package org.apache.etch.compiler.ast

Examples of org.apache.etch.compiler.ast.Service


  }

  private void checkMsgParamFieldRefOrEnumItem( Message msg, Parameter param,
    Token arg, int argNo ) throws ParseException
  {
    Service service = msg.parent();
   
    StringTokenizer path = new StringTokenizer( arg.image, "." );
    String name = path.nextToken();
   
    Parameter p = msg.getParameter( name );
    if (p != null)
    {
      // it's a parameter, so type of p must be a struct...

      p = getField( service, p, path );
     
      if (p == null)
        throw new ParseException( String.format(
          "Authorize method %s arg %d name does not resolve to a field (%s) at line %d",
          method.image, argNo+1, arg, lineno() ) );
     
      Named<?> pt = p.type().getNamed( service );
      Named<?> paramType = param.type().getNamed( service );
      if (pt == paramType)
        return;

      throw typeMismatch( param, arg, argNo );
    }
   
    // it isn't a parameter, so it must be an enum...
   
    Named<?> named = service.get( name );
    if (named == null)
      throw new ParseException( String.format(
        "Authorize method %s arg %d name unknown (%s) at line %d",
        method.image, argNo+1, arg, lineno() ) );
   
View Full Code Here

TOP

Related Classes of org.apache.etch.compiler.ast.Service

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.