Package gw.internal.gosu.parser
Class ContextSensitiveCodeRunner
java.lang.Object
gw.internal.gosu.parser.ContextSensitiveCodeRunner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ConcurrentHashMap<String,IGosuProgramInternal> private static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Object_runMeSomeCode(Object enclosingInstance, Object[] extSyms, String strText, String strClassContext, String strContextElementClass, int iSourcePosition) private static voidaddThisSymbolForEnhancement(IType enclosingType, ISymbolTable symTable) static voidcacheProgram(String strTypeName, IGosuProgramInternal program) private static voidstatic voidcollectLocalSymbols(IType enclosingType, ISymbolTable symTable, IParsedElement parsedElement, int iOffset) static ObjectcompileAndRunMeSomeCode(Object source, IGosuClass ctxClass, Object outer, IType enclosingClass, Object[] extSyms, int offset) (package private) static voidprivate static ISymbolTablefindCompileTimeSymbols(IGosuClassInternal enclosingClass, int iLocation) private static IParsedElementfindElemAt(IGosuClassInternal gsClass, int iContextLocation) private static ILocalVarDeclarationfindLocalVarSymbol(String strVar, IParsedElement pe) static IGosuProgramInternalgetCachedProgram(String strTypeName) private static booleanprivate static booleanisProgramFieldVar(IStatement stmt) private static IExternalSymbolMapmakeRuntimeNamesAndValues(Object[] extSyms) private static Stringprivate static Stringstatic ObjectrunMeSomeCode(Object enclosingInstance, ClassLoader cl, Object[] extSyms, String strText, String strClassContext, String strContextElementClass, int iSourcePosition) Intended for use with a debugger to evaluate arbitrary expressions/programs in the context of a source position being debugged, usually at a breakpoint.
-
Field Details
-
_cacheProgramByFingerprint
-
_refreshChecksum
private static int _refreshChecksum
-
-
Constructor Details
-
ContextSensitiveCodeRunner
public ContextSensitiveCodeRunner()
-
-
Method Details
-
ensureLoadedForDebuggerEval
static void ensureLoadedForDebuggerEval() -
runMeSomeCode
public static Object runMeSomeCode(Object enclosingInstance, ClassLoader cl, Object[] extSyms, String strText, String strClassContext, String strContextElementClass, int iSourcePosition) Intended for use with a debugger to evaluate arbitrary expressions/programs in the context of a source position being debugged, usually at a breakpoint.- Parameters:
enclosingInstance- The instance of the object immediately enclosing the source position.extSyms- An array of adjacent name/value pairs corresponding with the names and values of local symbols in scope.strText- The text of the expression/program.strClassContext- The name of the top-level class enclosing the the source position.strContextElementClass- The name of the class immediately enclosing the source position (can be same as strClassContext).iSourcePosition- The index of the source position within the containing file.- Returns:
- The result of the expression or, in the case of a program, the return value of the program.
-
_runMeSomeCode
-
compileAndRunMeSomeCode
-
cacheProgram
-
getCachedProgram
-
clearCacheOnChecksumChange
private static void clearCacheOnChecksumChange() -
printArgs
-
printArgs
-
isBlock
-
makeRuntimeNamesAndValues
-
findElemAt
-
findCompileTimeSymbols
private static ISymbolTable findCompileTimeSymbols(IGosuClassInternal enclosingClass, int iLocation) -
collectLocalSymbols
public static void collectLocalSymbols(IType enclosingType, ISymbolTable symTable, IParsedElement parsedElement, int iOffset) -
addThisSymbolForEnhancement
-
isProgramFieldVar
-
findLocalVarSymbol
-