parser.h
来源:互联网 发布:iframe 跨端口 编辑:程序博客网 时间:2024/04/29 03:19
parser.h
#include <google/protobuf/compiler/parser.h>
namespace google::protobuf::compiler
Implements parsing of .proto files to FileDescriptorProtos.
Classes in this file
Parser
SourceLocationTable
class Parser
#include <google/protobuf/compiler/parser.h>
namespace google::protobuf::compiler
Implements parsing of protocol definitions (such as .proto files).
Note that most users will be more interested in the Importer class. Parser is a lower-level class which simply converts a single .proto file to aFileDescriptorProto. It does not resolve import directives or perform many other kinds of validation needed to construct a complete FileDescriptor.
Members
Parser()
~Parser()
bool
Parse(io::Tokenizer * input, FileDescriptorProto * file)
void
RecordSourceLocationsTo(SourceLocationTable * location_table)
void
RecordErrorsTo(io::ErrorCollector * error_collector)
const string &
GetSyntaxIdentifier()
void
SetRequireSyntaxIdentifier(bool value)
void
SetStopAfterSyntaxIdentifier(bool value)
bool Parser::Parse(
io::Tokenizer * input,
FileDescriptorProto * file)
io::Tokenizer * input,
FileDescriptorProto * file)
Parse the entire input and construct a FileDescriptorProto representing it.
Returns true if no errors occurred, false otherwise.
void Parser::RecordSourceLocationsTo(
SourceLocationTable * location_table)
SourceLocationTable * location_table)
DEPRECATED: New code should use the SourceCodeInfo embedded in the FileDescriptorProto.
Requests that locations of certain definitions be recorded to the given SourceLocationTable while parsing. This can be used to look up exact line and column numbers for errors reported by DescriptorPool during validation. Set to NULL (the default) to discard source location information.
void Parser::RecordErrorsTo(
io::ErrorCollector * error_collector)
io::ErrorCollector * error_collector)
Requests that errors be recorded to the given ErrorCollector while parsing.
Set to NULL (the default) to discard error messages.
void Parser::SetRequireSyntaxIdentifier(
bool value)
bool value)
If set true, input files will be required to begin with a syntax identifier.
Otherwise, files may omit this. If a syntax identifier is provided, it must be 'syntax = "proto2";' and must appear at the top of this file regardless of whether or not it was required.
void Parser::SetStopAfterSyntaxIdentifier(
bool value)
bool value)
Call SetStopAfterSyntaxIdentifier(true) to tell the parser to stop parsing as soon as it has seen the syntax identifier, or lack thereof.
This is useful for quickly identifying the syntax of the file without parsing the whole thing. If this is enabled, no error will be recorded if the syntax identifier is something other than "proto2" (since presumably the caller intends to deal with that), but other kinds of errors (e.g. parse errors) will still be reported. When this is enabled, you may pass a NULL FileDescriptorProto to Parse().
class SourceLocationTable
#include <google/protobuf/compiler/parser.h>
namespace google::protobuf::compiler
A table mapping (descriptor, ErrorLocation) pairs -- as reported by DescriptorPool when validating descriptors -- to line and column numbers within the original source code.
This is semi-obsolete: FileDescriptorProto.source_code_info now contains far more complete information about source locations. However, as of this writing you still need to use SourceLocationTable when integrating with DescriptorPool.
Members
SourceLocationTable()
~SourceLocationTable()
bool
Find(const Message * descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int * line, int * column) const
void
Add(const Message * descriptor, DescriptorPool::ErrorCollector::ErrorLocation location, int line, int column)
void
Clear()
bool SourceLocationTable::Find(
const Message * descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location,
int * line,
int * column) const
const Message * descriptor,
DescriptorPool::ErrorCollector::ErrorLocation location,
int * line,
int * column) const
Finds the precise location of the given error and fills in *line and column with the line and column numbers.
If not found, sets *line to -1 and *column to 0 (since line = -1 is used to mean "error has no exact location" in the ErrorCollector interface). Returns true if found, false otherwise.
- parser.h
- libxml/parser.h not found
- "libxml/parser.h: 没有那个文件或目录"解决方案
- cant install nokogiri gem, “libxml/parser.h” not found
- "Parser.cpp:13:19: error: expat.h"的解决
- "libxml/parser.h: 没有那个文件或目录"解决方案
- iOS开发中,出现libxml/parser.h not found
- FFmpeg的H.264解码器源代码简单分析:解析器(Parser)部分
- 【ARM-Linux开发】"libxml/parser.h: 没有那个文件或目录"解决方案
- FFmpeg的H.264解码器源代码简单分析:解析器(Parser)部分
- FFmpeg的H.264解码器源代码简单分析:解析器(Parser)部分
- FFmpeg的H.264解码器源代码简单分析:解析器(Parser)部分
- fatal error: libxml/parser.h: No such file or directory解决方法
- iOS学习笔记21-当工程中提示#import <libxml/parser.h>不存在时,只需要两部操作即可
- sql parser
- SAX Parser
- XML PARSER
- XML parser
- Java编写双色球程序
- 更改数据库编码的sql语句
- java security2nd 读后 概要整理
- Jetty Hello World
- android 动态修改menu item的内容title
- parser.h
- plugin.h
- Phoenix 常用函数
- plugin.pb.h
- 彻底理解ThreadLocal
- cpp_generator.h
- STM32下载遇到 * JLink Info: Could not measure total IR len. TDO is constant high. 解决方法
- java_generator.h
- 安卓自学笔记:6:用ArrayAdapter创建ListView