gw.lang.GosuShop.createSymbol()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(88)

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

GosuShop.createSymbol介绍

暂无

代码示例

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

public static IExpression compileExpression(String script, String varName, IType varType, String varName2, IType varType2) throws ParseResultsException {
 StandardSymbolTable symbolTable = new StandardSymbolTable( true );
 symbolTable.putSymbol( GosuShop.createSymbol( varName, varType, null ) );
 symbolTable.putSymbol( GosuShop.createSymbol( varName2, varType2, null ) );
 return compileExpression(script, symbolTable );
}

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

private IType addValuesForType( List<ISymbol> listSymbols )
{
 IType expectedType = getGosuEditor().findExpectedTypeErrorAtCaret();
 if( expectedType != null && expectedType.isEnum() )
 {
  int[] i = {0};
  ((IEnumType)expectedType).getEnumConstants().forEach( e -> listSymbols.add( i[0]++, GosuShop.createSymbol( e, expectedType, null ) ) );
 }
 return expectedType;
}

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

public static IExpression compileExpression(String script, String varName, IType varType) throws ParseResultsException {
 StandardSymbolTable symbolTable = new StandardSymbolTable( true );
 symbolTable.putSymbol( GosuShop.createSymbol( varName, varType, null ) );
 return compileExpression(script, symbolTable );
}

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

/**
 * Evaluates the given Gosu, with variables of the given names that will be the
 * dynamic (runtime) type of the values passed in.
 *
 * @param args must be an array of alternating non-null name/value pairs
 */
public static Object evalGosu(String script, Object[] args) throws ParseResultsException
{
 ISymbolTable table = new StandardSymbolTable(true);
 assert(args.length % 2 == 0) : "You must pass in an array of matchign name/value pairs";
 for (int i = 0; i < args.length; i = i + 2) {
  String name = (String) args[i];
  Object arg = args[i + 1];
  assert arg != null : "Argument " + name + " is null, so we cannot determine the type for it.  " +
      "If you wish to actually pass a null value in, construct an ISybmolTable with the null value " +
      "properly typed and pass it in directly";
  table.putSymbol( GosuShop.createSymbol(name, TypeSystem.getFromObject(arg), arg));
 }
 return evalGosu(script, table);
}

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

void displayPathCompletion( final ISymbolTable transientSymTable )
{
 if( _bTemplate )
 {
  transientSymTable.putSymbol( GosuShop.createSymbol( ITemplateGenerator.PRINT_METHOD, new FunctionType( ITemplateGenerator.PRINT_METHOD, JavaTypes.pVOID(), new IType[]{JavaTypes.STRING(), JavaTypes.BOOLEAN()} ), null ) );
 }
 PathCompletionIntellisense.instance().complete( this, transientSymTable );
}

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

void displayPathCompletion( final ISymbolTable transientSymTable )
{
 if( _bTemplate )
 {
  transientSymTable.putSymbol( GosuShop.createSymbol( ITemplateGenerator.PRINT_METHOD, new FunctionType( ITemplateGenerator.PRINT_METHOD, JavaTypes.pVOID(), new IType[]{JavaTypes.STRING(), JavaTypes.pBOOLEAN()} ), null ) );
 }
 PathCompletionIntellisense.instance().complete( this, transientSymTable );
}

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

private ISymbolTable makeSymTable( Location loc, IType outermostType )
{
 if( outermostType instanceof IGosuClass )
 {
  return ContextSymbolTableUtil.getSymbolTableAtOffset( (IGosuClass)outermostType, StringUtil.getLineOffset( ((IGosuClass)outermostType).getSource(), loc.lineNumber() ) );
 }
 StandardSymbolTable symTable = new StandardSymbolTable();
 IType thisType = TypeSystem.getByFullNameIfValid( loc.declaringType().name().replace( '$', '.' ) );
 if( thisType != null )
 {
  symTable.putSymbol( GosuShop.createSymbol( Keyword.KW_this.getName(), thisType, null ) );
 }
 return symTable;
}

相关文章