class SemanticParser

Defined at line 92 of file ../../src/lib/fidl_codec/semantic_parser.h

Parser for the language which defines semantic rules for FIDL methods.

Public Methods

void NextLexicalToken ()

Reduce the next lexical token. The parser always has a current not used yet lexical token

reduced by NextLexicalToken.

Defined at line 64 of file ../../src/lib/fidl_codec/semantic_parser.cc

void SemanticParser (LibraryLoader * library_loader, std::string_view buffer, ParserErrors * errors)

Defined at line 94 of file ../../src/lib/fidl_codec/semantic_parser.h

Location GetLocation ()

Returns the location of the current lexical token.

Defined at line 101 of file ../../src/lib/fidl_codec/semantic_parser.h

std::ostream & AddError ()

Adds an error at the current lexical token location.

Defined at line 104 of file ../../src/lib/fidl_codec/semantic_parser.h

bool Is (std::string_view keyword)

Helpers to check that we currently have a specified lexical token.

Defined at line 131 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsEof ()

Defined at line 132 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsIdentifier ()

Defined at line 133 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsString ()

Defined at line 134 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsLeftBrace ()

Defined at line 135 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsRightBrace ()

Defined at line 136 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsRightParenthesis ()

Defined at line 137 of file ../../src/lib/fidl_codec/semantic_parser.h

void JumpToSemicolon ()

Skips text until a semicolon or a right brace are found. If a semicolon or a right brace are

found, the parsing continues before the semicolon or the right brace.

Defined at line 138 of file ../../src/lib/fidl_codec/semantic_parser.cc

bool IsColonColon ()

Defined at line 140 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsDot ()

Defined at line 141 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsEqual ()

Defined at line 142 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsSemicolon ()

Defined at line 143 of file ../../src/lib/fidl_codec/semantic_parser.h

bool IsSlash ()

Defined at line 144 of file ../../src/lib/fidl_codec/semantic_parser.h

bool Consume (std::string_view keyword)

Helpers to check and consume a specified lexical token.

Defined at line 147 of file ../../src/lib/fidl_codec/semantic_parser.h

void SkipSemicolon ()

Skips text until a semicolon or a right brace are found. If a semicolon is found, the parsing

continues after the semicolon. If a right brace is found, the parsing continues before the

right brace.

Defined at line 152 of file ../../src/lib/fidl_codec/semantic_parser.cc

bool Consume (LexicalToken token)

Defined at line 154 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeLeftBrace ()

Defined at line 161 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeRightBrace ()

Defined at line 162 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeLeftParenthesis ()

Defined at line 163 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeRightParenthesis ()

Defined at line 164 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeColon ()

Defined at line 165 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeDot ()

Defined at line 166 of file ../../src/lib/fidl_codec/semantic_parser.h

void SkipBlock ()

Skips text until a semicolon or a right brace are found. The parsing continue after the

semicolon or the right brace. If an embeded block is found (delimited by left and right

braces), the block is skipped.

Defined at line 166 of file ../../src/lib/fidl_codec/semantic_parser.cc

bool ConsumeEqual ()

Defined at line 167 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeSemicolon ()

Defined at line 168 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ConsumeSlash ()

Defined at line 169 of file ../../src/lib/fidl_codec/semantic_parser.h

bool Parse (std::string_view keyword)

Helpers to check and consume a specified lexical token. If the token is not found, an error is

generated.

Defined at line 173 of file ../../src/lib/fidl_codec/semantic_parser.h

void SkipRightBrace ()

Skips text until a right brace is found. The parsing continue after the right brace. If an

embeded block is found (delimited by left and right braces), the block is skipped.

Defined at line 180 of file ../../src/lib/fidl_codec/semantic_parser.cc

bool Parse (LexicalToken token, std::string_view token_string)

Defined at line 182 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseLeftBrace ()

Defined at line 191 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseRightBrace ()

Defined at line 192 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseLeftParenthesis ()

Defined at line 193 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseRightParenthesis ()

Defined at line 194 of file ../../src/lib/fidl_codec/semantic_parser.h

void SkipRightParenthesis ()

Skips text until a right parenthesis is found. The parsing continue after the right

parenthesis. If an embeded block is found (delimited by left and right braces or left and right

parentheses), the block is skipped. If a semicolon is found, the parsing resumes before the

semicolon.

Defined at line 194 of file ../../src/lib/fidl_codec/semantic_parser.cc

bool ParseColon ()

Defined at line 195 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseColonColon ()

Defined at line 196 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseComma ()

Defined at line 197 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseEqual ()

Defined at line 198 of file ../../src/lib/fidl_codec/semantic_parser.h

bool ParseSemicolon ()

Defined at line 199 of file ../../src/lib/fidl_codec/semantic_parser.h

std::string ConsumeString ()

Returns the current string. Escaped characters are resolved.

Then it advances to the next lexical item.

Defined at line 210 of file ../../src/lib/fidl_codec/semantic_parser.cc

void ParseSemantic ()

Parses a file which contains handle semantic rules.

Defined at line 226 of file ../../src/lib/fidl_codec/semantic_parser.cc

void ParseLibrary ()

Parses a library block.

Defined at line 237 of file ../../src/lib/fidl_codec/semantic_parser.cc

void ParseMethod (ProtocolMethod * method)

Parses a method (semantic rules and short displays).

Defined at line 302 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<DisplayExpression> ParseDisplayExpression ()

Parses an expression to display.

Defined at line 348 of file ../../src/lib/fidl_codec/semantic_parser.cc

void ParseAssignment (MethodSemantic * method_semantic)

Parses an assignment (that is a semantic rule).

Defined at line 363 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<Expression> ParseExpression ()

Parses an expression.

Defined at line 388 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<Expression> ParseMultiplicativeExpression ()

Parses a multiplicative expression (a factor).

Defined at line 392 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<Expression> ParseAccessExpression ()

Parses a field access expression.

Defined at line 416 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<Expression> ParseTerminalExpression ()

Parses terminal expressions.

Defined at line 437 of file ../../src/lib/fidl_codec/semantic_parser.cc

std::unique_ptr<Expression> ParseHandleDescription ()

Parses a handle description: HandleDescription(type, path).

Defined at line 453 of file ../../src/lib/fidl_codec/semantic_parser.cc