gw.lang.parser.Keyword.isReservedKeyword()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中gw.lang.parser.Keyword.isReservedKeyword()方法的一些代码示例,展示了Keyword.isReservedKeyword()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keyword.isReservedKeyword()方法的具体详情如下:
包路径:gw.lang.parser.Keyword
类名称:Keyword
方法名:isReservedKeyword

Keyword.isReservedKeyword介绍

暂无

代码示例

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

private boolean isReserved(String ident) {
 return Keyword.isReservedKeyword( ident );
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

public boolean isReservedWord( String strWord )
{
 return Keyword.isReservedKeyword( strWord );
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public boolean isReservedWord( String strWord )
{
 return Keyword.isReservedKeyword( strWord );
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-core

private boolean canExtendMethod( IMethodInfo mi )
{
 if( !(mi instanceof JavaMethodInfo) )
 {
  // It is possible that a methodinfo on a java type originates outside of java.
  // E.g., enhancement methods. Gosu does not support extending these.
  return false;
 }
 if( isPropertyMethod( mi ) )
 {
  // We favor properties over methods -- gotta pick one
  return false;
 }
 //## todo: maybe support implementing/overriding Java methods having a keyword as a name by escaping the keyword (using @ maybe?) so the parser can throw it away and not stop on the token as a reserved keyword 77
 if( Keyword.isReservedKeyword( mi.getDisplayName() ) )
 {
  return false;
 }
 int iMethodModifiers = ((IJavaMethodInfo)mi).getModifiers();
 return //!java.lang.reflect.Modifier.isFinal( iMethodModifiers ) &&
  !java.lang.reflect.Modifier.isNative( iMethodModifiers ) &&
  // See GosuClassInstanceFactory.genSuperClassMembers() (we don't allow finalizers)
  !mi.getDisplayName().equals( "finalize" ) &&
  mi.getDisplayName().indexOf( '$' ) < 0;
}

代码示例来源:origin: gosu-lang/old-gosu-repo

warn( element, !Keyword.isReservedKeyword( strFunctionName ), Res.MSG_IMPROPER_USE_OF_KEYWORD, strFunctionName );

代码示例来源:origin: org.gosu-lang.gosu/gosu-core

warn( element, !Keyword.isReservedKeyword( strFunctionName ), Res.MSG_IMPROPER_USE_OF_KEYWORD, strFunctionName );

相关文章