Class: CppCommentsParser

CppCommentsParser(root_directory_path, options)

C/C++ preprocessed input comments parser

Constructor

new CppCommentsParser(root_directory_path, options)

constructor
Parameters:
Name Type Description
root_directory_path string root directory path
options CppCommentsParserOptions C/C++ preprocessed input comments parser options
Source:

Methods

add(compilation_unit)

Add a compilation unit
Parameters:
Name Type Description
compilation_unit CompilationUnit compilation unit
Source:

error(msg)

Log an error message
Parameters:
Name Type Description
msg string an error message
Source:

expect_char(input, c) → {boolean}

Expect a character
Parameters:
Name Type Description
input PreprocessedInput preprocessed input
c string expected character
Source:
Returns:
true=success, false=failure
Type
boolean

expect_white_space(input) → {boolean}

Expect white space (one or more blank characters).
Parameters:
Name Type Description
input PreprocessedInput preprocessed input
Source:
Returns:
true=success, false=failure
Type
boolean

fix_path(file_path) → {string}

Fix path
Parameters:
Name Type Description
file_path string a file path to fix
Source:
Returns:
a fixed file path
Type
string

log(msg)

Log a message
Parameters:
Name Type Description
msg string a message
Source:

parse() → {Promise.<CppComments>}

Parse preprocessed input of all compilation units
Source:
Returns:
a promise
Type
Promise.<CppComments>

parse_line_marker(input, comp_unit) → {Marker|undefined}

Parse a preprocessor line marker directive
Parameters:
Name Type Description
input PreprocessedInput preprocessed input
comp_unit CompilationUnit compilation unit
Source:
Returns:
the parsed line marker or undefined if parsing failed
Type
Marker | undefined

parse_number(input) → {Number|undefined}

Parse a decimal natural number
Parameters:
Name Type Description
input PreprocessedInput preprocessed input
Source:
Returns:
the parsed number or undefined if parsing failed
Type
Number | undefined

parse_string(input) → {string|undefined}

Parse a C/C++ string
Parameters:
Name Type Description
input PreprocessedInput preprocessed input
Source:
Returns:
the parsed string or undefined if parsing failed
Type
string | undefined

scan(compilation_unit)

Scan content of preprocessed input of a compilation unit
Parameters:
Name Type Description
compilation_unit CompilationUnit compilation unit
Source:

warn(msg)

Log a warning message
Parameters:
Name Type Description
msg string a warning message
Source: