bnf

Regular Expression

I have a grammar defined as follows: A -> aA*b | empty_string Is A a regular expression? I'm confused as to how to interpret a BNF grammar. ...

What's the BNF of doctrine for?

It looks like a big mess,how does it work as reference? http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language%3Abnf ...

Converting EBNF to BNF

It's been a few years since my computer-language class and so I've forgotten the finer points of BNF's and EBNF's and I don't have a textbook next to me. Specifically, I've forgotten how to convert an EBNF into BNF. From what little I remember, I know that one of the main points is to convert { term } into <term> | <many-terms>. But I d...

Grammar for Java's annotations

Is there a BNF or EBNF that describes the grammar for Java's annotations? ...

Is it easier to write a recursive-descent parser using an EBNF or a BNF?

I've got a BNF and EBNF for a grammar. The BNF is obviously more verbose. I have a fairly good idea as far as using the BNF to build a recursive-descent parser; there are many resources for this. I am having trouble finding resources to convert an EBNF to a recursive-descent parser. Is this because it's more difficult? I recall from my C...

BNF vs EBNF vs ABNF: which to choose?

I want to come up with a language syntax. I have read a bit about these three, and can't really see anything that one can do that another can't. Is there any reason to use one over another? Or is it just a matter of preference? ...

How to correctly formalize the command line usage of GNU/Linux commands?

I'd like to write down a BNF-like formal grammar for describing the command line usage of some GNU/Linux tools. For example I can describe the usage of the cat command as: (cat-command) : 'cat' (arguments-list) (arguments-list) : (argument) (arguments-list) : (arguments-list) (argument) (argument) : (file) The problem is I can't write...

Is there a standard lexer/parser tool for Python?

A volunteer job requires us to convert a large number of LaTeX documents into ePub format. It's a series of open-source fiction book which has so far only been produced only on paper via a print on demand service. We'd like to be able to offer the book to users of book-reader devices (such as Kindle) which require the ePub format for bes...

URL BNF search part does not make sense

Hi, While implementing a Java regular expression for URL based on the URL BNF published by W3C, I've failed to understand the search part. As quoted: httpaddress h t t p : / / hostport [ / path ] [ ? search ] search xalphas [ + search ] xalphas xalpha [ xalp...

Generating test cases to abuse a BNF grammar automagically.

Hi, I am wondering if there is a tool or technique which, given a BNF grammar, adjusts it randomly(but intelligently) and generates a stream of output for use in detecting cases that slip past the BNF (but shouldn't). edit: Fuzz testing a parser, in other words. Thanks ...

Is there a tool for generating a DSL parser that does not require a runtime for the resultant parser?

I'm doing a lot of work with a DSLs at the moment and was wondering if anyone knew of a tool that could generate a parser for my bnf specification that does not require a run-time library (pure java source parser)? I'm committed to using XTEXT for a future Eclipse plug-in but I need a nice small version for my library itself and don't w...

String Manipulation in C

Hi guys, I am helping my nephew for his C lab homework, it is a string manipulation assignment and applying Wang's algorithm. Here is the BNF representation for the input. <s> ::= <l> # <r> <l> ::= <list>| ε <r> ::= <list>| ε <list> ::= <f>|<f> , <list> <f> ::= <letter>| - <f>| (<f><op><f>) <op> ::= & | | | > <letter> ::= A |... | Z ...

BNF to handle escape sequence

I use this BNF to parser my script: ` {identset} = {ASCII} - {"\{\}}; //<--all ascii charset except '\"' '{' and '}' {strset} = {ASCII} - {"}; ident = {identset}*; str = {strset}*; node ::= ident "{" nodes "}" | //<--entry point "\"" str "\"" | ident; nodes ::= node nodes | ...

What is the name of such notation?

JSON web site uses very clear notation to describe JSON's syntax: What is the name of such notation? Is this is just a graphical presentation of BNF or it has it's own name? ...

Parser expression for comma-separated function call parameters

Im writing a parser than can parse expressions like myfunc1(), myfunc2(param1) and myfunc3(param1, param2) (with an unknown amount of parameters). Now I'm trying to get my parse expressions right. I'm using the Lemon Parser Generator. Here is what I've come up with: application(res) ::= APPLICATIONNAME(a) BRACE_OPEN params BRACE_CLOSE. ...

BNF / EBNF for Turbo Pascal (preferably 5.5 or later, because of OOP)?

Does anyone of you know if the BNF or EBNF of Turbo Pascal is available somewhere (LEGALLY!!)? ...

ANTLR, how to convert BNF,EBNF data in ANTLR?

I have to generate parser of CSV data. Somehow I managed to write BNF, EBNF for CSV data but I don't know how to convert this into an ANTLR grammar (which is a parser generator). For example, in EBNF we write: [{header entry}newline]newline but when I write this in ANTLR to generate a parser, it's giving an error and not taking brack...

Can I improve this GOLD Parser Grammar?

I have to parse a file that looks like this: versioninfo { "editorversion" "400" "editorbuild" "4715" } visgroups { } world { "id" "1" "mapversion" "525" "classname" "worldspawn" solid { "id" "2" side { "id" "1" "plane" "(-544 -400 0) (-544 -240 0) (-272 -240 0)...

In the Backus-Naur Form what does a comma ',' mean while defining a symbol

Hello, I am as much newbie to Pi-Calculus as I am with Backus Naur Form. Here is one of the core BNF for Pi Calculus ( found in "Applied Pi - A Brief Tutorial" by Peter Sewell) P,Q ::= 0 nil P | Q parallel composition of P and Q ~cv output v on channel c ...

Full BNF grammar for HL7 2.5

Hi, all I was wondering if anyone had a full BNF for HL7 2.5? I am looking to compile this using the gold parser engine but would be happy to convert from EBNF or vendor specific BNF. ...