For a while, I have been intrigued by the fact that ANTLR is not able to parse the following free context grammar rule: S → 'x' S 'x' | 'X'.
It did not seem difficult to me.
As far as I know, ANTLR is the most powerful LL parser. Are there other parser generators (LR or others) that can generate a parser for this?
g
Cohen
, LL (n) LALR (n) LR (n) n. . n. n x, . , - , ?
x
( n), , , . , , , ; , , S → 'x' 'x' S | 'x', .
Antlr , :
grammar fred; sentence : ( 'x' 'x' 'x' ) => 'x' sentence 'x' | 'x' ;
, , 1 . : " " x ", " x ", .
Antlr 3.3/Antlrworks 1.4.2 :
- , , :
grammar fred; start : sentence ; sentence : 'x' 'x'('x' 'x')* 'x' | 'x' ;
, , ( ) .
Source: https://habr.com/ru/post/1792547/More articles:maximum function c tree height - cTwo questions about properties in C # - c #'undefined' appears in the message - javascriptHow to make haskell not store whole bytes? - optimizationTesting Entity Framework 3.5 - c #Closure Compiler Completion - Any Performance Hits? - performanceMvc binding error from json to enum (customexception from int to listing) - jsonWhat correct configuration line should be designed, omniauth and google work? - ruby-on-railsHow to run and debug a C ++ application in Eclipse that started with a script? - c ++AccessViolationException from System.Windows.Forms using WinFormsHost in WPF - c #All Articles