ebnf

Use existing languages in BNF with TinyPG?

≯℡__Kan透↙ 提交于 2019-12-21 05:52:57
问题 How can I use these BNF grammars which are in GOLD meta-syntax (RegExp + BNF) with TinyPG? I'm new to BNF so approximately what sort of conversion will I have to do to convert BNF to EBNF? I believe it should be pretty simple since TinyPG needs RegExp + EBNF in comparison to the GOLD grammars which are RegExp + BNF . Also, is there any TinyPG source code for any language available, just to see what sort of conversion I would have to do? 回答1: EBNF is not entirely backwards compatible with BNF,

Use existing languages in BNF with TinyPG?

余生颓废 提交于 2019-12-21 05:52:12
问题 How can I use these BNF grammars which are in GOLD meta-syntax (RegExp + BNF) with TinyPG? I'm new to BNF so approximately what sort of conversion will I have to do to convert BNF to EBNF? I believe it should be pretty simple since TinyPG needs RegExp + EBNF in comparison to the GOLD grammars which are RegExp + BNF . Also, is there any TinyPG source code for any language available, just to see what sort of conversion I would have to do? 回答1: EBNF is not entirely backwards compatible with BNF,

POSIX sh EBNF grammar

寵の児 提交于 2019-12-20 14:21:45
问题 Is there an existing POSIX sh grammar available or do I have to figure it out from the specification directly? Note I'm not so much interested in a pure sh; an extended but conformant sh is also more than fine for my purposes. 回答1: The POSIX standard defines the grammar for the POSIX shell. The definition includes an annotated Yacc grammar. As such, it can be converted to EBNF more or less mechanically. If you want a 'real' grammar, then you have to look harder. Choose your 'real shell' and

EBNF or BNF for the LOGO programming language

只愿长相守 提交于 2019-12-20 12:23:47
问题 Does anyone know where I can get the BNF or EBNF for the LOGO programming language? 回答1: A BNF grammar might not be too useful in certain circumstances... Writing a LOGO that's accurately compatible with existing/historical implementation isn't an easy task (I worked on such a project). The problem is that the parser doesn't do the full job, and the evaluator (interpreter) has to work with partial data. Consider this example: proc1 a b proc2 c It could mean proc1(a, b, proc2(c)) or proc1(a, b

EBNF or BNF for the LOGO programming language

…衆ロ難τιáo~ 提交于 2019-12-20 12:22:06
问题 Does anyone know where I can get the BNF or EBNF for the LOGO programming language? 回答1: A BNF grammar might not be too useful in certain circumstances... Writing a LOGO that's accurately compatible with existing/historical implementation isn't an easy task (I worked on such a project). The problem is that the parser doesn't do the full job, and the evaluator (interpreter) has to work with partial data. Consider this example: proc1 a b proc2 c It could mean proc1(a, b, proc2(c)) or proc1(a, b

BNF vs EBNF vs ABNF: which to choose?

有些话、适合烂在心里 提交于 2019-12-20 09:48:35
问题 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? 回答1: You have to think about EBNF and ABNF as extensions that help you just to be more concise and expressive while developing your grammars. For example think about an optional non-terminal symbol, in a BNF grammar you would define it by using intermediate symbols

BNF to standard EBNF

こ雲淡風輕ζ 提交于 2019-12-13 07:30:49
问题 I am converting BNF dialect 2 to standard EBNF and making the grammar as simple as possible from this problem below. <state> -> <abc> | <abc>; <state> -> <def> | <def>; <state> -> <ghi> | <ghi>; here is my attempt that I followed along page 131 in my textbook http://umsl.edu/~mfrp9/misc/cpl.pdf <state> -> (<abc> | <abc>)(<def> | <def)(<ghi> | <ghi>); Is this a correct solution and is there a simpler solution than this with {...} for repeated? Also I noticed in this post How to convert BNF to

Ebnf – Is this an LL(1) grammar?

会有一股神秘感。 提交于 2019-12-12 12:27:07
问题 I found the following EBNF on wikipedia, describing EBNF: letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ; digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; symbol = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">" | "'" | '"' | "=" | "|" | "." | "," | ";" ; character = letter | digit | symbol | "_" ; identifier = letter , { letter | digit | "_" } ; terminal = "'"

Generate EBNF from ANTLR

早过忘川 提交于 2019-12-12 08:11:08
问题 Anybody know of a tool, that generates EBNF from ANTLR? ANTLR is already close to EBNF, but for documentation purpose I would like to have a clean EBNF description (without the Code in between). With antlrworks and this its already nice to get the syntax diagrams: java -cp antlrworks-1.1.4.jar org.antlr.works.Console -f yql.g -o output/ -sd eps but it would like to have a bare textual description, preferable text, tex, html, xml, or similar. 回答1: I have an online tool that converts foreign

EBNF grammar to ANTLR3?

这一生的挚爱 提交于 2019-12-12 05:50:01
问题 I have this EBNF grammar for the Jass scripting language. What needs to be done to convert it to work with ANTLR 3.5? Furthermore, are there any sort of tools available to aid me in doing so? //---------------------------------------------------------------------- // Global Declarations //---------------------------------------------------------------------- program ::= file+ file ::= newline? ( declr newline )* func* declr ::= typedef | globals | native_func typedef ::= 'type' id 'extends' (