* @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;
}