public ReducedSymbol( ISymbol arg ) { _name = arg.getName(); _displayName = _name; _type = arg.getType(); _scriptPartId = arg.getScriptPart(); _defValue = arg.getDefaultValueExpression(); _modifiers = arg.getModifiers(); _annotations = arg.getAnnotations(); _symClass = arg.getClass(); _bValueBoxed = arg.isValueBoxed(); _iIndex = arg.getIndex(); }
private String getScriptText( ISymbol symbol ) { if( symbol.getType() instanceof IFunctionType && !(symbol.getType() instanceof IBlockType) ) { return editor.util.EditorUtilities.buildFunctionIntellisenseString( false, (IFunctionType)symbol.getType() ); } else { return symbol.getDisplayName(); } }
@Override public boolean isLocal() { return _referredSymbol.isLocal(); }
public void setSymbol( ISymbol symbol, ISymbolTable symTable ) { // Make a copy of the symbol without the value so that the parsed expression // doesn't hold onto pointers it shouldn't _symbol = symbol.getLightWeightReference(); if( _symbol.hasDynamicSymbolTable() ) { _symbol.setDynamicSymbolTable( symTable ); } }
@Override public String getName() { return _arg.getName(); }
IGosuClassInternal gsClass = (IGosuClassInternal)symbol.getGosuClass(); gsClass.isValid(); VarStatement varStmt = gsClass.getStaticField( symbol.getName() ); if( varStmt != null ) throw new IllegalStateException( "Should have found field for: " + symbol.getName() ); IType type = symbol.getType(); Object value = symbol.getValue();
private String getDisplayText( ISymbol symbol ) { if( symbol.getType() instanceof IFunctionType ) { IFunctionType type = (IFunctionType)symbol.getType(); return type.getName() + getParamSignatureText( symbol ) + " : " + getReturnTypeText( type.getReturnType() ); } else { return symbol.getName() + " : " + getTypeDisplayText( symbol.getType() ); } }
verify( as, idSym.isWritable() || (idSym.isFinal() && !idSym.isStatic() && !(idSym instanceof CapturedSymbol) && ((idSym.isLocal() && !((Symbol)idSym).isImplicitlyInitialized()) || Res.MSG_PROPERTY_NOT_WRITABLE, idSym.getDisplayName() ); if( !settersOwningClass.isAccessible( ctxClass, setter ) ) id.addParseException( Res.MSG_PROPERTY_NOT_VISIBLE, idSym.getDisplayName() ); if( idSym != null && idSym.equals( identifier.getSymbol() ) ) as.addParseWarning( new ParseWarning( makeFullParserState(), Res.MSG_SILLY_ASSIGNMENT, idSym.getName() ) ); if( dps.getVarIdentifier() != null && dps.getVarIdentifier().equals( idSym.getName() ) ) as.addParseWarning( new ParseWarning( makeFullParserState(), Res.MSG_SILLY_ASSIGNMENT, idSym.getName() ) );
IType type = symbol.getType(); if ( _cc().isExternalSymbol( symbol.getName() ) ) Arrays.asList( pushConstant( symbol.getName() ), boxValue( _stmt().getExpression().getType(), ExpressionTransformer.compile( _stmt().getExpression(), _cc() ) ) ) ); return buildMethodCall( setterCall ); numericLiteral(0), rhsValue, irProp.getType().getComponentType() ); else if( symbol.getIndex() >= 0 ) if( symbol.isValueBoxed() ) return buildArrayStore( identifier( _cc().getSymbol( symbol.getName() ) ), numericLiteral( 0 ), rhsValue, return buildAssignment( _cc().getSymbol( symbol.getName() ), rhsValue );
private boolean areSymbolsFromSameDeclaration(IVarStatement varStmt, ISymbol existingSymbol) { boolean sameDeclaringType = GosuObjectUtil.equals(existingSymbol.getScriptPart(), varStmt.getSymbol().getScriptPart()); if( sameDeclaringType ) { return true; } if( existingSymbol.getScriptPart() != null ) { IGosuClassInternal existingDeclaringType = (IGosuClassInternal)existingSymbol.getScriptPart().getContainingType(); if( isProxy() && existingDeclaringType.isProxy() ) { // This class is a Java proxy and so is the declaring class of the existing symbol. In this case we need to get // the JavaType corresponding with this class' proxy and find where the existing symbol comes from within the Java // hierarchy. IPropertyInfo pi = ((IRelativeTypeInfo)getJavaType().getTypeInfo()).getProperty( getTheRef(), existingSymbol.getName() ); return pi != null && pi.getOwnersType() == existingDeclaringType.getJavaType(); } } return false; }
if( symbol.getType() instanceof IFunctionType ) IMethodInfo mi = ((IFunctionType)symbol.getType()).getMethodInfo(); if( mi != null ) IScriptPartId scriptPart = symbol.getScriptPart(); if( scriptPart != null ) if( type != null ) IPropertyInfo pi = type.getTypeInfo().getProperty( symbol.getName() ); if( pi != null ) BeanInfoNode node = new BeanInfoNode( symbol.getType(), getDisplayText( symbol ) )
@Override public IType getFeatureType() { return _arg.getType(); }
private void assignCapturedParamIndexes( List<IRStatement> statements ) { for( ISymbol paramSym : getActualArgSymbols() ) { if (paramSym.isValueBoxed()) { IRSymbol symbol = new IRSymbol(paramSym.getName(), getDescriptor(paramSym.getType().getArrayType()), false); _cc().putSymbol(symbol); IRExpression expression = identifier(_cc().getSymbol(symbol.getName() + "$$unboxedParam")); IRExpression value = buildInitializedArray(getDescriptor(paramSym.getType()), exprList(expression)); statements.add(buildAssignment(symbol, value)); } } }
public boolean isStaticFinalInitializedCompileTimeConstant() { ISymbol symbol = getSymbol(); if ( symbol instanceof DynamicSymbol && symbol.isStatic() && symbol.isFinal() ) { IGosuClassInternal gsClass = (IGosuClassInternal)symbol.getGosuClass(); if ( !gsClass.isValid() ) { return false; } VarStatement varStmt = gsClass.getStaticField( symbol.getName() ); if( varStmt != null && varStmt.getAsExpression() != null ) { return varStmt.getAsExpression().isCompileTimeConstant(); } } return false; }
handleGotoFeature( symbol.getGosuClass().getTypeInfo().getProperty( symbol.getGosuClass(), symbol.getName() ) ); else if( symbol.isLocal() )
String strName = csr.getName(); if( csr.getGosuClass() == ds.getGosuClass() || bInjected )
if( symbol != null && !symbol.getDisplayName().equals( strPropertyName ) ) symbol.getGosuClass() == getGosuClass() && (((DynamicPropertySymbol)symbol).getVarIdentifier() != null && !((DynamicPropertySymbol)symbol).getVarIdentifier().equals( strVarIdentifier) ) )
public void putSymbol( ISymbol symbol ) { String name = (String)symbol.getName(); //noinspection unchecked peekScope().put( name, symbol ); symbol.setDynamicSymbolTable( this ); }
@Override public String getDescription() { return _symbol.getDisplayName(); }