Package etch.compiler.ast

Examples of etch.compiler.ast.Parameter


        method.image, lineno() ) );
   
    int n = argList.size();
    for (int i = 0; i < n; i++)
    {
      Parameter param = authParams.get( i );
      AuthArg aarg = argList.get( i );
      aarg.setType( param.type() );
      Token arg = aarg.value();
     
//      System.out.printf( "auth method %s param %s = %s\n",
//        method, param.name(), arg );
     
View Full Code Here


    }

  private void checkMsgParamOrServiceConst( Message msg, Parameter param,
    Token arg, int argNo ) throws ParseException
  {
    Parameter p = msg.getParameter( arg.image );
    if (p != null)
    {
      // it's a parameter, do the types match?
     
      Named<?> pt = p.type().getNamed( msg.parent() );
      Named<?> paramType = param.type().getNamed( msg.parent() );
      if (pt == paramType)
        return;
     
      throw typeMismatch( param, arg, argNo );
View Full Code Here

    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 );
View Full Code Here

  @Override
  public String getValidator( Named<?> named )
  {
    if (named instanceof Parameter)
    {
      Parameter param = (Parameter) named;
      TypeRef type = param.type();

      if (type.isBuiltin())
        return "Validator_" + type.type() + ".Get( " + type.dim()
          + " )";
View Full Code Here

  @Override
  public String getValidator( Named<?> named )
  {
    if (named instanceof Parameter)
    {
      Parameter param = (Parameter) named;
      TypeRef type = param.type();

      if (type.isBuiltin())
        return String.format( "Validator_%s.get( %d )",
          type.type(), type.dim() );
View Full Code Here

        m.descr().add( s );
      }
      else if (type == Type.Param)
      {
//        System.out.printf( "adding to p.descr (%s): %s\n", name, s );
        Parameter p = m.getParameter( name );
        if (p != null)
          p.descr().add( s );
        else
          System.out.printf( "*** warning: cannot document parameter %s of %s\n", name, m.name() );
      }
      else if (type == Type.Return)
      {
View Full Code Here

  @Override
  public String getValidator( Named<?> named )
  {
    if (named instanceof Parameter)
    {
      Parameter param = (Parameter) named;
      TypeRef type = param.type();

      if (type.isBuiltin())
        return "Validator_"+type.type()+".get( "+type.dim()+" )";

      return "Validator_custom.getCustom( "+type.getNamed( type.intf() ).efqname( this )+".class, "+type.dim()+" )";
View Full Code Here

        method.image, lineno() ) );
   
    int n = argList.size();
    for (int i = 0; i < n; i++)
    {
      Parameter param = authParams.get( i );
      AuthArg aarg = argList.get( i );
      aarg.setType( param.type() );
      Token arg = aarg.value();
     
//      System.out.printf( "auth method %s param %s = %s\n",
//        method, param.name(), arg );
     
View Full Code Here

    }

  private void checkMsgParamOrServiceConst( Message msg, Parameter param,
    Token arg, int argNo ) throws ParseException
  {
    Parameter p = msg.getParameter( arg.image );
    if (p != null)
    {
      // it's a parameter, do the types match?
     
      Named<?> pt = p.type().getNamed( msg.parent() );
      Named<?> paramType = param.type().getNamed( msg.parent() );
      if (pt == paramType)
        return;
     
      throw typeMismatch( param, arg, argNo );
View Full Code Here

    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 );
View Full Code Here

TOP

Related Classes of etch.compiler.ast.Parameter

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.