tree-grammar

Systematic way to generate ANTLR tree grammar?

我是研究僧i 提交于 2019-12-09 06:39:57
问题 I have a little bit large ANTLR parser grammar file and want to make a tree grammar for it. But, as far as I know this work of tree grammar generation can't be done automatically, i.e., I should generate it manually by copying parser grammar, removing some unnecessary code, etc. I want to know if there is a systematic way to generate a tree grammar file from a parser grammar file. P.S. I read an article that insists that 'Manual Tree Walking Is Better Than Tree Grammars'. Is this reliable

Systematic way to generate ANTLR tree grammar?

折月煮酒 提交于 2019-12-03 07:38:13
I have a little bit large ANTLR parser grammar file and want to make a tree grammar for it. But, as far as I know this work of tree grammar generation can't be done automatically, i.e., I should generate it manually by copying parser grammar, removing some unnecessary code, etc. I want to know if there is a systematic way to generate a tree grammar file from a parser grammar file. P.S. I read an article that insists that ' Manual Tree Walking Is Better Than Tree Grammars '. Is this reliable information? If so, would it be better for me to make a manual tree walker than writing an ANTLR tree

How to parse Markdown in PHP?

被刻印的时光 ゝ 提交于 2019-11-29 21:23:40
First, I know, there already is a Markdown parser for PHP. I also took a look to this question but it doesn't answer to my question. Obviously, even if the title mention PHP, if it's language agnostic, because I'd like to know what are the step I've to go through to do that. I've read about PEG , but I've to admit, I didn't really understand the example provided with the PHP parser. I've also read about CFG . I've found Zend_Markup_Parser_Textile which seems to construct a so called "Token Tree" (what's about it?) but it currently unusable . (Btw, Textile is not Markdown) So, concretely, how

How to parse Markdown in PHP?

旧城冷巷雨未停 提交于 2019-11-28 18:57:09
问题 First, I know, there already is a Markdown parser for PHP. I also took a look to this question but it doesn't answer to my question. Obviously, even if the title mention PHP, if it's language agnostic, because I'd like to know what are the step I've to go through to do that. I've read about PEG, but I've to admit, I didn't really understand the example provided with the PHP parser. I've also read about CFG. I've found Zend_Markup_Parser_Textile which seems to construct a so called "Token Tree