org.bridj.demangling
Class Demangler

java.lang.Object
  extended by org.bridj.demangling.Demangler
Direct Known Subclasses:
GCC4Demangler, VC9Demangler

public abstract class Demangler
extends Object

Base class and core structures for symbol demanglers (typically, for C++ symbols).


Nested Class Summary
static interface Demangler.Annotations
           
static class Demangler.ClassRef
           
static class Demangler.Constant
           
static class Demangler.DemanglingException
           
static class Demangler.FunctionTypeRef
           
static class Demangler.Ident
           
static interface Demangler.IdentLike
           
static class Demangler.JavaTypeRef
           
static class Demangler.MemberRef
           
static class Demangler.NamespaceRef
           
static class Demangler.PointerTypeRef
           
static class Demangler.SpecialName
           
static class Demangler.Symbol
           
static interface Demangler.TemplateArg
           
static class Demangler.TypeRef
           
 
Field Summary
protected  int length
           
protected  NativeLibrary library
           
protected  int position
           
protected  String str
           
 
Constructor Summary
Demangler(NativeLibrary library, String str)
           
 
Method Summary
static Demangler.Annotations annotations(AnnotatedElement e)
           
static Demangler.Annotations annotations(Annotation[] aa)
           
static Demangler.Annotations annotations(Type e)
           
protected static Demangler.TypeRef classType(Class<?> c, Class<? extends Annotation>... annotations)
           
protected static Demangler.TypeRef classType(Class<?> c, Type[] genericTypes, Class<? extends Annotation>... annotations)
           
protected  char consumeChar()
           
protected  boolean consumeCharIf(char... allowedChars)
           
protected  boolean consumeCharsIf(char... nextChars)
           
static boolean equivalentTypes(Type a, Type b)
           
protected  Demangler.DemanglingException error(int deltaPosition)
           
protected  Demangler.DemanglingException error(String mess)
           
protected  Demangler.DemanglingException error(String mess, int deltaPosition)
           
protected  void expectAnyChar(char... cs)
           
protected  void expectChars(char... cs)
           
static String getMethodName(Method method)
           
 String getString()
           
static StringBuilder implode(StringBuilder b, Iterable<?> items, String sep)
           
static StringBuilder implode(StringBuilder b, Object[] items, String sep)
           
protected  char lastChar()
           
static void main(String[] args)
           
abstract  Demangler.MemberRef parseSymbol()
           
protected  char peekChar()
           
protected  char peekChar(int dist)
           
protected static Demangler.TypeRef pointerType(Demangler.TypeRef tr)
           
protected static Demangler.TypeRef simpleType(Demangler.Ident ident)
           
protected static Demangler.TypeRef simpleType(String name, Demangler.TemplateArg... args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

str

protected final String str

length

protected final int length

position

protected int position

library

protected final NativeLibrary library
Constructor Detail

Demangler

public Demangler(NativeLibrary library,
                 String str)
Method Detail

main

public static void main(String[] args)

annotations

public static Demangler.Annotations annotations(Annotation[] aa)

annotations

public static Demangler.Annotations annotations(Type e)

annotations

public static Demangler.Annotations annotations(AnnotatedElement e)

parseSymbol

public abstract Demangler.MemberRef parseSymbol()
                                         throws Demangler.DemanglingException
Throws:
Demangler.DemanglingException

getString

public String getString()

expectChars

protected void expectChars(char... cs)
                    throws Demangler.DemanglingException
Throws:
Demangler.DemanglingException

expectAnyChar

protected void expectAnyChar(char... cs)
                      throws Demangler.DemanglingException
Throws:
Demangler.DemanglingException

implode

public static StringBuilder implode(StringBuilder b,
                                    Object[] items,
                                    String sep)

implode

public static StringBuilder implode(StringBuilder b,
                                    Iterable<?> items,
                                    String sep)

peekChar

protected char peekChar()

peekChar

protected char peekChar(int dist)

lastChar

protected char lastChar()

consumeChar

protected char consumeChar()
                    throws Demangler.DemanglingException
Throws:
Demangler.DemanglingException

consumeCharsIf

protected boolean consumeCharsIf(char... nextChars)

consumeCharIf

protected boolean consumeCharIf(char... allowedChars)

error

protected Demangler.DemanglingException error(int deltaPosition)

error

protected Demangler.DemanglingException error(String mess)

error

protected Demangler.DemanglingException error(String mess,
                                              int deltaPosition)

getMethodName

public static String getMethodName(Method method)

pointerType

protected static Demangler.TypeRef pointerType(Demangler.TypeRef tr)

classType

protected static Demangler.TypeRef classType(Class<?> c,
                                             Class<? extends Annotation>... annotations)

classType

protected static Demangler.TypeRef classType(Class<?> c,
                                             Type[] genericTypes,
                                             Class<? extends Annotation>... annotations)

simpleType

protected static Demangler.TypeRef simpleType(String name,
                                              Demangler.TemplateArg... args)

simpleType

protected static Demangler.TypeRef simpleType(Demangler.Ident ident)

equivalentTypes

public static boolean equivalentTypes(Type a,
                                      Type b)


Copyright © 2009-2012. All Rights Reserved.