Package org.apache.etch.compiler

Examples of org.apache.etch.compiler.Token


  @Override
  public String getTypeValue( TypeRef type, Token value )
  {
    // System.out.println( "getTypeValue called with: "+type+": "+value );
    Token t = type.type();
    switch (t.kind)
    {
      case EtchGrammarConstants.LONG:
        return value.image + "L";
      case EtchGrammarConstants.FLOAT:
View Full Code Here


   * while etch string -> csharp string.
   */
  @Override
  public String getNativeTypeName( TypeRef type )
  {
    Token t = type.type();
    switch (t.kind)
    {
      case EtchGrammarConstants.VOID:
        return "void";
      case EtchGrammarConstants.BOOLEAN:
View Full Code Here

   * @return the fundamental native reference type for java. so etch int ->
   * csharp int?, while etch string -> csharp string.
   */
  private String getRefTypeName( TypeRef type )
  {
    Token t = type.type();
    switch (t.kind)
    {
      case EtchGrammarConstants.VOID:
        return "void";
      case EtchGrammarConstants.BOOLEAN:
View Full Code Here

    addType( Service.class );
   
    if (args.length != 1)
      throw new ParseException( String.format( "Direction args length != 1" ) );
   
    Token arg = args[0];
    if (arg.kind != EtchGrammarConstants.ID)
      throw new ParseException( String.format( "Direction arg should be identifier: "+arg.image ) );
   
    try
    {
View Full Code Here

        "Unchecked accepts one optional boolean argument at line %d",
        name.token.beginLine ) );
   
    if (args.length > 0)
    {
      Token arg = args[0];
      if (arg.kind != EtchGrammarConstants.TRUE &&
          arg.kind != EtchGrammarConstants.FALSE)
        throw new ParseException( String.format(
          "Unchecked accepts one optional boolean argument at line %d",
          name.token.beginLine ) );
View Full Code Here

    if (args.length != 1)
      throw new ParseException( String.format(
        "ToString accepts one string argument at line %d",
        name.token.beginLine ) );
   
    Token arg = args[0];
    if (arg.kind != EtchGrammarConstants.STR)
      throw new ParseException( String.format(
        "ToString accepts one string argument at line %d",
        arg.beginLine ) );
   
View Full Code Here

    addType( Message.class );
    addType( Service.class );
   
    if (args == null || args.length == 0)
    {
      method = new Token();
      method.kind = EtchGrammarConstants.TRUE;
      method.beginLine = name.token.beginLine;
      argList = new ArrayList<AuthArg>();
      return;
    }
View Full Code Here

    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 );
     
      switch (arg.kind)
View Full Code Here

  @Override
  public String getTypeValue( TypeRef type, Token value ) throws Exception
  {
//    System.out.println( "getTypeValue called with: "+type+": "+value );
    Token t = type.type();
    switch (t.kind)
    {
      case EtchGrammarConstants.STRING: return protectString( value.image );
      default: return value.image;
    }
View Full Code Here

   * int -> java int, while etch string -> java String.
   */
  @Override
  public String getNativeTypeName( TypeRef type )
  {
    Token t = type.type();
    switch (t.kind)
    {
      case EtchGrammarConstants.VOID: return "void";
      case EtchGrammarConstants.BOOLEAN: return "boolean";
      case EtchGrammarConstants.BYTE: return "byte";
View Full Code Here

TOP

Related Classes of org.apache.etch.compiler.Token

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.