Class ContextSensitiveCodeRunner

java.lang.Object
gw.internal.gosu.parser.ContextSensitiveCodeRunner

public class ContextSensitiveCodeRunner extends Object
  • Field Details

  • 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

      private static Object _runMeSomeCode(Object enclosingInstance, Object[] extSyms, String strText, String strClassContext, String strContextElementClass, int iSourcePosition)
    • compileAndRunMeSomeCode

      public static Object compileAndRunMeSomeCode(Object source, IGosuClass ctxClass, Object outer, IType enclosingClass, Object[] extSyms, int offset)
    • cacheProgram

      public static void cacheProgram(String strTypeName, IGosuProgramInternal program)
    • getCachedProgram

      public static IGosuProgramInternal getCachedProgram(String strTypeName)
    • clearCacheOnChecksumChange

      private static void clearCacheOnChecksumChange()
    • printArgs

      private static String printArgs(Class[] parameterTypes)
    • printArgs

      private static String printArgs(List<Object> args)
    • isBlock

      private static boolean isBlock(String fqn)
    • makeRuntimeNamesAndValues

      private static IExternalSymbolMap makeRuntimeNamesAndValues(Object[] extSyms)
    • findElemAt

      private static IParsedElement findElemAt(IGosuClassInternal gsClass, int iContextLocation)
    • findCompileTimeSymbols

      private static ISymbolTable findCompileTimeSymbols(IGosuClassInternal enclosingClass, int iLocation)
    • collectLocalSymbols

      public static void collectLocalSymbols(IType enclosingType, ISymbolTable symTable, IParsedElement parsedElement, int iOffset)
    • addThisSymbolForEnhancement

      private static void addThisSymbolForEnhancement(IType enclosingType, ISymbolTable symTable)
    • isProgramFieldVar

      private static boolean isProgramFieldVar(IStatement stmt)
    • findLocalVarSymbol

      private static ILocalVarDeclaration findLocalVarSymbol(String strVar, IParsedElement pe)