Re: syntax: It really means string literal, whose value must be "proto2" or
"proto3".

Looks like it's been cleaned up, but not long ago it also had an incorrect
definition for the service syntax, suggesting an alternate way to define
streaming methods that protoc did not actually support.

Anyhow, I've gone through the exercise of writing a parser in Go
<https://godoc.org/github.com/jhump/protoreflect/desc/protoparse> and
learned a lot. The parser I wrote leverages yacc, which may provide a
useful starting point for creating a parser in C#:
https://github.com/jhump/protoreflect/blob/master/desc/protoparse/proto.y

I know the code in the productions is all Go, but the layout of the grammar
is more or less right. (I have tests that load a variety of proto files,
with a variety of language features therein, and makes sure that my package
produces equivalent descriptors to protoc.)

----
*Josh Humphries*
[email protected]


On Wed, Oct 31, 2018 at 12:23 PM Michael Powell <[email protected]>
wrote:

> On Wed, Oct 31, 2018 at 12:22 PM Michael Powell <[email protected]>
> wrote:
> >
> > Concerning Constant, literally from the v2 spec:
>
> Rather, Syntax section, excuse me...
>
> > syntax = "syntax" "=" quote "proto2" quote ";"
> >
> > Do I read that correctly you can expect either 'proto2' or "proto2",
> > but never 'proto2" nor "proto2' ?
> >
> > If accurate, that just seems to me to be lazy spec authorship...
> >
> > Thanks!
> > On Wed, Oct 31, 2018 at 12:07 PM Michael Powell <[email protected]>
> wrote:
> > >
> > > Hello,
> > >
> > > I am writing a parser for the Proto language specification starting
> > > with v2. I need a little help interpreting one of the lines if you
> > > please:
> > >
> > > In the "String literals" section, what does this mean:
> > >
> > > charValue = hexEscape | octEscape | charEscape | /[^\0\n\\]/
> > >
> > > Specifically, the trailing list of character soup? I want to say that
> > > there are escaped characters in the sequence? Or am I to take that
> > > string literally? Or notwithstanding the enclosing forward slashes?
> > >
> > > Thanks much in advance!
> > >
> > > Best regards,
> > >
> > > Michael Powell
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to