Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
package Synopsis::Parser::C++
class LinkMap
Files: Synopsis/Parser/C++/syn/link_map.hh

LinkMap is a map from preprocessed file positions to input file positions


Public Member functions Summary:
 constructorLinkMap()
Constructor [Source]
static LinkMap*instance()
Returns a reference to a singleton instance of link_map [Source]
 voidadd(const char* name, int line, int out_start, int out_end, int diff)
Adds a map at the given line. [Source]
 intmap(int line, int col)
Applies added maps to the given column number. [Source]
 voidclear()
Clears the map. [Source]

Private Data members Summary:
Private*m [Source]

Structs Summary:
Private [Source]

Public Member function Details:
 void add(const char* name, int line, int out_start, int out_end, int diff)

Adds a map at the given line. out_{start,end} define the start and past-the-end markers for the macro in the output file. diff defines the signed difference to add to the pos.

See Also:
map(int, int)


 int map(int line, int col)

Applies added maps to the given column number. The differentials of the various macros are applied in turn, and the final column position is returned. Returns -1 if col is inside a macro


 void clear()

Clears the map. Should be called at the very start of processing, since the map is stored statically and hence potentially across parser invocations.