title: LL grammar with associativity and self referring productions
body: <p>I am trying to write a parser grammar and currently have the following productions for an LL Grammar (in Antlr) and I am trying to parse one or more (numbers or strings) that is separated by a "#" that is right associative. How do I modify the the productions so that it can parse one or more strings separated by "#" instead of just one at the moment? </p>
  
  <pre><code>A ::= B
      | Number
      | String
  
  B ::= C "-&gt;" A
  
  C ::= Number
      | String
  </code></pre>
  
  <p>Examples of languages for this grammar:</p>
  
  <pre><code>ABC # 123
  123 # ABC
  ABC # DEF # 123
  ABC # DEF # (123 # 456)
  ABC # (DEF # 123) # 456
  </code></pre>
  
  <p>I tried using the EBNF form </p>
  
  <pre><code>A ::= B
      | Number
      | String
      | "(" A ")"
  
  B ::= C ("#" A)?
  
  C ::= Number
      | String
  </code></pre>
  
  <p>But that causes my Grammar to be ambiguous. How would I fix this ambiguity? </p>