Package etch.compiler

Examples of etch.compiler.Token


    if (reqMsg.getResultMessage() != null)
      return;
   
    Name rmName = reqMsg.getResultMessageName();

    Token rmType = new Token();
    rmType.kind = EtchGrammarConstants.VOID;
    rmType.image = "void";
    TypeRef rmTypeRef = new TypeRef( this, rmType );
   
    nameList.check( rmName );
View Full Code Here


  @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 -> java 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 ->
   * java Integer, while etch string -> java 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

  @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

   * @param type
   * @return true if the type is an etch builtin type.
   */
  public boolean isBasicType(TypeRef type) {
   
    Token t = type.type();
   
    switch (t.kind)
    {
    case EtchGrammarConstants.VOID:
      return true;
    case EtchGrammarConstants.BOOLEAN:
      return true;
    case EtchGrammarConstants.BYTE:
      return true;
    case EtchGrammarConstants.SHORT:
      return true;
    case EtchGrammarConstants.INT:
      return true;
    case EtchGrammarConstants.LONG:
      return true;
    case EtchGrammarConstants.FLOAT:
      return true;
    case EtchGrammarConstants.DOUBLE:
      return true;
    case EtchGrammarConstants.STRING:
      return true;
    case EtchGrammarConstants.OBJECT:
      return true;

    // patch here. more generic approach needed.
    // currently, only taking care of Map, Set, List & Datetime
    case EtchGrammarConstants.ID:
      if ( t.toString().equals("Map") || t.toString().equals("List") ||
          t.toString().equals("Set") || t.toString().equals("Datetime") )
        return true;
    }
    return false;
  }
View Full Code Here

   * @return the fundamental native reference type for java.
   * so etch int -> java Integer, while etch string -> java String.
   */
  private String getRefTypeName( 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 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.