| java.lang.Object xtc.lang.jeannie.Utilities
Utilities | final public class Utilities (Code) | | Static helper routines related to JNI and Jeannie.
This is a good place to put code that is useful for more than one visitor.
author: Martin Hirzel version: $Revision: 1.21 $ |
Inner Class :static class MiniVisitor_containsCToJavaTransition extends Visitor | |
Inner Class :static class MiniVisitor_containsJavaToCTransition extends Visitor | |
Inner Class :static class MiniVisitor_findScopeBoundaries extends Visitor | |
Inner Class :static class MiniVisitor_getSimpleDeclarators extends Visitor | |
Inner Class :static class MiniVisitor_getTopLevelDeclarations extends Visitor | |
Method Summary | |
public static C | c() | public static String | cAstToString(Node ast) Don't use this method gratuitously. | public static Type | cPtrToBaseType(Type cPtrType) | public static GNode | cStringToAst(String production, String code) | public static GNode | cStringToAst(String production, String code, Set<String> typedefs) | public static Type | cStringToType(String code) | public static Type | cStringToType(String code, Set<String> typedefs) | public static GNode | cTypeToAst(Type type, String id, String production) | public static Type | cTypeToJavaType(SymbolTable tab, Runtime runtime, Node n, Type cType) | public static String | cTypeToString(Type type) | public static String | cTypeToString(Type type, String id) | public static boolean | containsCToJavaTransition(Node n) | public static boolean | containsJavaToCTransition(GNode n) | public static String | copyDropAuto(String string) | public static Type | currentFunctionOrMethod(SymbolTable tab) | public static String | debuggerAstToString(GNode ast) | public static DebuggerSymbolMapper | debuggerNewSymbolMapper() | public static Object | debuggerParseAndAnalyze(String language, String input, DebuggerSymbolMapper mapper) Parse the input as a debugger command, and analyze the resulting AST. | public static GNode | debuggerStringToAst(String language, String input) | public static void | dumpLineMarkers(Set<LineMarker> ms, int limit) | public static Type | getJavaClassOrInterfaceT(Type t) | public static String | getSimpleDeclarator(GNode declNode) | public static Set<String> | getSimpleDeclarators(GNode declNode) | public static boolean | hasTypedefName(Type t, String name) | public static boolean | isJavaEntity(Type e) | public static boolean | isPtrChar(Type t) | public static boolean | isPtrTypedef(Type t, String typedefName) | public static String | javaAstToString(Node ast) | public static boolean | javaIsStaticMethod(GNode n) | public static boolean | javaIsVoidMethod(GNode n) | public static String | javaTypeToApiType(Type type) | public static String | javaTypeToApiType(Type type, boolean upcase, boolean arrays) | public static Type | javaTypeToCType(SymbolTable tab, Runtime runtime, Node n, Type jType, boolean keepIfClassOrInterface) | public static String | jeannieAstToString(GNode ast, String language) | public static GNode | jeannieStringToAst(String production, String language, String code) | public static GNode | jeannieStringToAst(String production, String language, String escaped, boolean simple) | public static String | jniMangledName(String name) Part of name of C function implementing Java method as expected by linker,
see JNI Specification §11.3. | public static String | jniMangledName(SymbolTable tab, Type type) | public static Runtime | newRuntime() | static void | printLocalVariableMap(PrintWriter out, Node root, SymbolTable tab, CodeGenerator.Substitutions cSubstitutions, CodeGenerator.Substitutions javaSubstitutions) | static void | printLocalVariableMap_helper(PrintWriter out, SymbolTable tab, MiniVisitor_findScopeBoundaries boundaries, String language, CodeGenerator.Substitutions substitutions) | public static void | printTopLevelDeclarations(PrintWriter out, Node root) | public static Type | pureCType(SymbolTable tab, Runtime runtime, Type javaOrCType) | public static String | qualifiedIdentifierToString(GNode n) | public static Type | returnType(Type functionOrMethod) | public static Set<String> | standardJniTypeDefs() | public static Set<String> | stringSet(Object s) | public static String | stringSetToString(Set<String> s) | public static Set<String> | typedefs(Type r) | public static String | upcaseFirstLetter(String s) |
cAstToString | public static String cAstToString(Node ast)(Code) | | Don't use this method gratuitously. Originally, I used this to serialize
ASTs into strings, then concatenated the strings into more code, then
reparsed the result to a larger AST. But that is not only slow, it is also
brittle, since the same typedefs must be available during both parses.
Chances are you can use the ast directly as a parameter to an AST factory
generated by FactoryFactory.
|
containsCToJavaTransition | public static boolean containsCToJavaTransition(Node n)(Code) | | |
containsJavaToCTransition | public static boolean containsJavaToCTransition(GNode n)(Code) | | |
debuggerParseAndAnalyze | public static Object debuggerParseAndAnalyze(String language, String input, DebuggerSymbolMapper mapper)(Code) | | Parse the input as a debugger command, and analyze the resulting AST. If
either the parse or the analysis fails, return a message String. If neither
fails, return an AST Node. If the input contains an embedded expression,
the language argument determines whether it is "C" or "Java". The analyzer
annotates each node in the AST with the language for that node. It also
looks up variables and annotates them with their remapping based on the
current file and line number, where available.
|
getJavaClassOrInterfaceT | public static Type getJavaClassOrInterfaceT(Type t)(Code) | | |
isJavaEntity | public static boolean isJavaEntity(Type e)(Code) | | |
isPtrChar | public static boolean isPtrChar(Type t)(Code) | | |
isPtrTypedef | public static boolean isPtrTypedef(Type t, String typedefName)(Code) | | |
javaIsStaticMethod | public static boolean javaIsStaticMethod(GNode n)(Code) | | |
javaIsVoidMethod | public static boolean javaIsVoidMethod(GNode n)(Code) | | |
javaTypeToApiType | public static String javaTypeToApiType(Type type, boolean upcase, boolean arrays)(Code) | | |
jniMangledName | public static String jniMangledName(String name)(Code) | | Part of name of C function implementing Java method as expected by linker,
see JNI Specification §11.3.
|
qualifiedIdentifierToString | public static String qualifiedIdentifierToString(GNode n)(Code) | | |
|
|