0

i am working on a haskell compiler written in java using JLex and cup .i finished my lexer file and now i am working on my parser.cup file where i should define my terminals , non-terminals and the grammar. i have already finished the terminal and non-terminal part but now i am stuck in the grammar part so can anyone help or redirect me to any link where i can find a grammar for haskell in this form :

Variable ::= Nonterminal:name Terminal:name 
{:RESULT = /* code to execute when the rule is 
matched and the result to be printed out */ ;:} 
| blablabla ;

any help would be appreciated .

Halawa
  • 1,171
  • 2
  • 9
  • 19
  • You might find [this thread](http://www.reddit.com/r/haskell/comments/2ig8ml/where_can_i_find_the_complete_bnf_syntax_of/) highly relevant – Gabriella Gonzalez Apr 26 '15 at 03:57
  • unfortunately , no one give the BNF grammar which is in the form mentioned above . but thank you anyways . – Halawa Apr 26 '15 at 04:32
  • @GabrielGonzalez now my cup is semi finished but when i compile i got this error `./Lexer.java:4: error: Lexer is not abstract and does not override abstract method next_token() in Scanner` which leads to many errors of the same type `./Lexer.java:377: error: incompatible types return new Symbol(sym.EOF, null); ^ required: String found: Symbol` , any help ? – Halawa Apr 26 '15 at 05:36

0 Answers0