public sunConstantSymbol MustResolveConstant(sunIdentifier node) { var symbol = ResolveConstant(node); if (symbol == null) { throw new sunUndeclaredVariableException(node); } return(symbol); }
sunConstantSymbol DeclareConstant(sunIdentifier node, sunExpression expression, sunSymbolModifiers modifiers) { var local = (modifiers & sunSymbolModifiers.Local) != 0; var name = MangleSymbolName(node.Value, node.Location.ScriptId, false, local); var symbol = Scopes.DeclareConstant(name, expression); if (symbol == null) { throw new sunRedeclaredVariableException(node); } return(symbol); }
public sunStorableSymbol ResolveStorable(sunIdentifier node) { var global = node.Value; var local = MangleSymbolName(global, node.Location.ScriptId, false, true); var symbol = ResolveStorable(local); if (symbol != null) { return(symbol); } symbol = ResolveStorable(global); if (symbol != null) { return(symbol); } return(null); }
sunVariableSymbol DeclareVariable(sunIdentifier node, sunSymbolModifiers modifiers) { var local = (modifiers & sunSymbolModifiers.Local) != 0; var name = MangleSymbolName(node.Value, node.Location.ScriptId, false, local); var symbol = Scopes.DeclareVariable(name); if (symbol == null) { throw new sunRedeclaredVariableException(node); } #if SSC_SCOPES if (Scopes.Top.Type == sunScopeType.Script) { #else if (Scopes.Count == 1) { #endif SymbolTable.Add(symbol); } return(symbol); }
public sunConstantSymbol ResolveConstant(sunIdentifier node) { return(ResolveStorable(node) as sunConstantSymbol); }
public sunVariableSymbol ResolveVariable(sunIdentifier node) { return(ResolveStorable(node) as sunVariableSymbol); }