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

Stores link information about the file. Link info is stored in two files with two purposes.

The first file stores all links and non-link spans, in a simple text file with one record per line and with spaces as field separators. The fields themselves are encoded using URL-style %FF encoding of non alpha-numeric characters (including spaces, brackers, commas etc). The purpose of this file is for syntax-hightlighting of source files.

The second file stores only cross-reference information, which is a subset of the first file.


Public Enums Summary:
ContextReference, Definition, Span, Implementation, UsingDirective, UsingDeclaration, FunctionCall, NumContext
Enumeration of record types [Source]

Public Member functions Summary:
 constructorLinkStore(FileFilter* filter, SWalker* swalker)
Constructor. [Source]
 destructor~LinkStore()
Destructor. [Source]
 voidlink(Ptree* node, Context, const ScopedName& name, const std::string& desc, const AST::Declaration* decl = __null)
Store a link for the given Ptree node. [Source]
 voidlink(Ptree* node, const AST::Declaration* decl)
Store a Definition link for the given Ptree node using the AST node [Source]
 voidlink(Ptree* node, Types::Type*, Context = Reference)
Store a link for the given node using the given Context, which defaults to a Reference [Source]
 voidspan(int line, int col, int len, const char* desc)
Store a span [Source]
 voidspan(Ptree* node, const char* desc)
Store a span for the given Ptree node [Source]
 voidlong_span(Ptree* node, const char* desc)
Store a long (possibly multi-line) span [Source]
 SWalker*swalker()
Returns the SWalker [Source]

Protected Member functions Summary:
 voidstore_syntax_record(AST::SourceFile*, int line, int col, int len, Context context, const ScopedName& name, const std::string& desc)
Store a link in the Syntax File [Source]
 voidstore_xref_record(AST::SourceFile*, const AST::Declaration* decl, const std::string& file, int line, Context context)
Store a link in the CrossRef File [Source]
 std::ostream&get_syntax_stream(AST::SourceFile*)
Gets the ostream for a syntax file [Source]
 std::ostream&get_xref_stream(AST::SourceFile*)
Gets the ostream for a xref file [Source]
 intfind_col(int line, const char* ptr)
Calculates the column number of 'ptr'. [Source]

Protected Data members Summary:
Private*m
Compiler firewalled private data [Source]

Classes Summary:
encode [Source]
encode_name [Source]

Structs Summary:
Private [Source]

Public Enum Details:
enum Context
Reference
Definition

< General name reference

Span

< Definition of the declaration

Implementation

< Non-declarative span of text

UsingDirective

< Implementation of a declaration

UsingDeclaration

< Referenced in a using directive

FunctionCall

< Referenced in a using declaration

NumContext

< Called as a function

Enumeration of record types


Public Member function Details:
 constructor LinkStore(FileFilter* filter, SWalker* swalker)

Constructor.

Parameters:
filter - the filter to use to decide whether to output syntax and xref records
swalker - the SWalker object we are linking for


 destructor ~LinkStore()

Destructor. Closes all opened file streams


 void link(Ptree* node, Context, const ScopedName& name, const std::string& desc, const AST::Declaration* decl = __null)

Store a link for the given Ptree node. If a decl is given, store an xref too


Protected Member function Details:
 int find_col(int line, const char* ptr)

Calculates the column number of 'ptr'. m_buffer_start is used as a lower bounds, since the function counts backwards until it finds a newline. As an added bonus, the returned column number is adjusted using the link map generated from expanding macros so it can be output straight to the link file :) The adjustment requires the line number.