February 16, 2011Re: Context-Free Grammars? What about arrays?
Posted in reply to Nick Sabalausky
> Yes, they just happen to look identical: but that's the crux: How it "looks" is the *only* thing that parser/grammar are concerned with. > If it worked like this: > <Array Decl> ::= <Type> '[' <Ident> ']' <Ident> ';' > <Assoc Array Decl> ::= <Type> '[' <Ident> ']' <Ident> ';' > ...*Then* it would no longer be context-free because the parser would have to rely on the semantics of 'U' to determine how to parse it. Ahh that makes sense. Thank you for the great explanation! :)