本文整理了Java中gw.lang.parser.Keyword
类的一些代码示例,展示了Keyword
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keyword
类的具体详情如下:
包路径:gw.lang.parser.Keyword
类名称:Keyword
暂无
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
@Override
public String toString()
{
return Keyword.KW_null.toString();
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core-api
public String keyword() {
switch( this ) {
case Enhancement:
return Keyword.KW_enhancement.getName();
case Interface:
return Keyword.KW_interface.getName();
case Structure:
return Keyword.KW_structure.getName();
case Annotation:
return Keyword.KW_annotation.getName();
case Enum:
return Keyword.KW_enum.getName();
case Class:
case Program:
case Template:
case Eval:
case JavaClass:
return Keyword.KW_class.getName();
default:
return "<unknown>";
}
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
public boolean isReservedWord( String strWord )
{
return Keyword.isReservedKeyword( strWord );
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
private ClassType getClassType( String strValue )
{
return
Keyword.KW_class.toString().equals( strValue )
? ClassType.Class
: Keyword.KW_interface.equals( strValue )
? ClassType.Interface
: Keyword.KW_annotation.equals( strValue )
? ClassType.Annotation
: Keyword.KW_structure.equals( strValue )
? ClassType.Structure
: Keyword.KW_enum.toString().equals( strValue )
? ClassType.Enum
: null;
}
代码示例来源:origin: gosu-lang/old-gosu-repo
warn( element, !Keyword.isReservedKeyword( strFunctionName ), Res.MSG_IMPROPER_USE_OF_KEYWORD, strFunctionName );
fakeT._strValue = Keyword.KW_void.toString();
typeLiteral = resolveTypeLiteral( fakeT );
verify( element, !bGetter, Res.MSG_MISSING_PROPERTY_RETURN );
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
@Override
public boolean isValueKeyword()
{
return _keyword != null && _keyword.isValue();
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
boolean isDeclarationKeyword( String strKeyword )
{
return strKeyword != null &&
(Keyword.KW_function.equals( strKeyword ) ||
Keyword.KW_construct.equals( strKeyword ) ||
Keyword.KW_property.equals( strKeyword ) ||
//Keyword.KW_var.equals( strFunctionName ) ||
Keyword.KW_delegate.equals( strKeyword ) ||
Keyword.KW_class.equals( strKeyword ) ||
Keyword.KW_interface.equals( strKeyword ) ||
Keyword.KW_annotation.equals( strKeyword ) ||
Keyword.KW_structure.equals( strKeyword ) ||
Keyword.KW_enum.equals( strKeyword ));
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core-api
private static Keyword addReservedWord( String strWord )
{
return addReservedWord( strWord, false );
}
private static Keyword addReservedWord( String strWord, boolean bValue )
代码示例来源:origin: org.gosu-lang.gosu/gosu-core-api
private static Keyword addReservedWord( String strWord, boolean bValue )
{
if( RESERVED_WORDS.containsKey( strWord ) )
{
throw new RuntimeException( strWord + " is already defined as a reserved word." );
}
Keyword keyword = new Keyword( strWord, bValue );
RESERVED_WORDS.put( strWord, keyword );
return keyword;
}
代码示例来源:origin: gosu-lang/old-gosu-repo
private ClassType getClassType( String strValue )
{
return
Keyword.KW_class.toString().equals( strValue )
? ClassType.Class
: Keyword.KW_interface.equals( strValue )
? ClassType.Interface
: Keyword.KW_structure.equals( strValue )
? ClassType.Structure
: Keyword.KW_enum.toString().equals( strValue )
? ClassType.Enum
: null;
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
warn( element, !Keyword.isReservedKeyword( strFunctionName ), Res.MSG_IMPROPER_USE_OF_KEYWORD, strFunctionName );
String[] fakeT = {Keyword.KW_void.toString()};
typeLiteral = resolveTypeLiteral( fakeT );
verify( element, !bGetter, Res.MSG_MISSING_PROPERTY_RETURN );
代码示例来源:origin: org.gosu-lang.gosu/gosu-core-api
public static boolean isReservedKeyword( String strWord )
{
Keyword keyword = RESERVED_WORDS.get( strWord );
return keyword != null && !keyword.isValue();
}
代码示例来源:origin: gosu-lang/old-gosu-repo
boolean isDeclarationKeyword( String strKeyword )
{
return strKeyword != null &&
(Keyword.KW_function.equals( strKeyword ) ||
Keyword.KW_construct.equals( strKeyword ) ||
Keyword.KW_property.equals( strKeyword ) ||
//Keyword.KW_var.equals( strFunctionName ) ||
Keyword.KW_delegate.equals( strKeyword ) ||
Keyword.KW_class.equals( strKeyword ) ||
Keyword.KW_interface.equals( strKeyword ) ||
Keyword.KW_structure.equals( strKeyword ) ||
Keyword.KW_enum.equals( strKeyword ));
}
代码示例来源:origin: gosu-lang/old-gosu-repo
private static Keyword addReservedWord( String strWord )
{
return addReservedWord( strWord, false );
}
private static Keyword addReservedWord( String strWord, boolean bValue )
代码示例来源:origin: gosu-lang/old-gosu-repo
private static Keyword addReservedWord( String strWord, boolean bValue )
{
String strLower = strWord.toLowerCase();
if( RESERVED_WORDS.containsKey( strLower ) )
{
throw new RuntimeException( strWord + " is already defined as a reserved word." );
}
Keyword keyword = new Keyword( strWord, bValue );
RESERVED_WORDS.put( strWord, keyword );
return keyword;
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
public String getDisplayName()
{
return Keyword.KW_super.toString();
}
代码示例来源:origin: gosu-lang/old-gosu-repo
public static boolean isExactKeywordMatch( String strValue )
{
Keyword keyword = RESERVED_WORDS.get( strValue );
return keyword.getName().equals( strValue );
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core
if( s.getName().equals( Keyword.KW_outer.toString() ) )
getGosuClass().getEnclosingType() != null &&
getGosuClass().getEnclosingType().isInterface() &&
s.getName().equals( Keyword.KW_outer.toString() ) )
!Keyword.KW_super.equals( s.getName() ), Res.MSG_SUPER_NOT_ACCESSIBLE_FROM_BLOCK );
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
public boolean isReservedWord( String strWord )
{
return Keyword.isReservedKeyword( strWord );
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-core-api
public static boolean isValueKeyword( String strWord )
{
Keyword keyword = RESERVED_WORDS.get( strWord );
return keyword != null && keyword.isValue();
}
内容来源于网络,如有侵权,请联系作者删除!