bnf

Use existing languages in BNF with TinyPG?

浪子不回头ぞ 提交于 2019-12-03 21:42:49
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? EBNF is not entirely backwards compatible with BNF, however the differences are actually slight, you should be familiar with the document at http://www.cs.cmu

_Actual_ Twitter format for hashtags? Not your regex, not his code— the actual one?

你说的曾经没有我的故事 提交于 2019-12-03 17:13:22
问题 Update: Use Twitter's Entities if you can- they figured it out for you as well as other items. My case is that I just have the tweet without entities and all the extra metadata I've spent what I consider an unreasonable amount of time trying to find the actual format for hashtags. As far as my searching can tell- Twitter has not published one. I know that many people have come up with regex's to parse them, however, your lib's regex is not my lib's regex and maybe I don't like yours anyway.

Regular expression for a language tag (as defined by BCP47)

一笑奈何 提交于 2019-12-03 13:16:54
问题 I need a regular expression for a language tag as defined by BCP 47. I know that the full BNF syntax is available at http://www.rfc-editor.org/rfc/bcp/bcp47.txt and that I could use it to write my own, but hopefully there is one already out there. 回答1: Looks like this: ^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux| i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban| cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh

Context-free grammar for C

China☆狼群 提交于 2019-12-03 08:46:36
问题 I'm working on a parser for C. I'm trying to find a list of all of the context-free derivations for C. Ideally it would be in BNF or similar. I'm sure such a thing is out there, but googling around hasn't given me much. Reading the source code for existing parsers/compilers has proven to be far more confusing than helpful, as most that I've found are much more ambitious and complicated than the one I'm building. 回答1: You could always use Annex A of the C11 standard itself. The freely

_Actual_ Twitter format for hashtags? Not your regex, not his code— the actual one?

那年仲夏 提交于 2019-12-03 05:32:27
Update: Use Twitter's Entities if you can- they figured it out for you as well as other items. My case is that I just have the tweet without entities and all the extra metadata I've spent what I consider an unreasonable amount of time trying to find the actual format for hashtags. As far as my searching can tell- Twitter has not published one. I know that many people have come up with regex's to parse them, however, your lib's regex is not my lib's regex and maybe I don't like yours anyway. So I'm asking- is there any actual official spec? I don't want a regex answer, I want a BNF or something

Regular expression for a language tag (as defined by BCP47)

廉价感情. 提交于 2019-12-03 02:46:52
I need a regular expression for a language tag as defined by BCP 47 . I know that the full BNF syntax is available at http://www.rfc-editor.org/rfc/bcp/bcp47.txt and that I could use it to write my own, but hopefully there is one already out there. Looks like this: ^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux| i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban| cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language> ([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A

EBNF or BNF for the LOGO programming language

梦想与她 提交于 2019-12-03 02:23:54
Does anyone know where I can get the BNF or EBNF for the LOGO programming language? 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, proc2(), c) according to the number of parameters for proc1 & proc2. Furthermore the LOGO interpreters I

Where can I find standard BNF or YACC grammar for C++ language?

房东的猫 提交于 2019-12-03 02:22:23
问题 I'm trying to work on a kind of code generator to help unit-testing an legacy C/C++ blended project. I don't find any kind of independent tool can generate stub code from declaration. So I decide to build one, it shouldn't be that hard. Please, anybody can point me a standard grammar link, better described by yacc language. Hope I'm not reinventing wheel, please help me out in that case. Best Regards, Kevin 回答1: From the C++ FAQ Lite: 38.11 Is there a yacc-able C++ grammar? The primary yacc

Context-free grammar for C

我是研究僧i 提交于 2019-12-02 22:44:34
I'm working on a parser for C. I'm trying to find a list of all of the context-free derivations for C. Ideally it would be in BNF or similar. I'm sure such a thing is out there, but googling around hasn't given me much. Reading the source code for existing parsers/compilers has proven to be far more confusing than helpful, as most that I've found are much more ambitious and complicated than the one I'm building. You could always use Annex A of the C11 standard itself. The freely available draft standard will work for your purposes, at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf .

Where can I find standard BNF or YACC grammar for C++ language?

点点圈 提交于 2019-12-02 15:54:18
I'm trying to work on a kind of code generator to help unit-testing an legacy C/C++ blended project. I don't find any kind of independent tool can generate stub code from declaration. So I decide to build one, it shouldn't be that hard. Please, anybody can point me a standard grammar link, better described by yacc language. Hope I'm not reinventing wheel, please help me out in that case. Best Regards, Kevin From the C++ FAQ Lite : 38.11 Is there a yacc-able C++ grammar? The primary yacc grammar you'll want is from Ed Willink. Ed believes his grammar is fully compliant with the ISO/ANSI C++