1

I am planning to build compiler for Requirement Specification Language. I have come up with idea using JFlex as lexical analyzer and CUP as parser.

Can any one let me know it is possible to use JFlex and CUP for formal specification language? All the documentation and tutorials are related to programming language only.

Any tutorial available for building formal language compiler.

rds
  • 26,253
  • 19
  • 107
  • 134
man19688
  • 301
  • 1
  • 2
  • 6

1 Answers1

1

Lexer and parser generators do not care if your langauge is "conventional computer langauge", only that your langauge has a grammar specification they can handle.

Ofteh the way you get a such a grammar specification, is to take a specification for your formal system as given, and bend it according to the constraints of your chosen parser generator. This bending process is at best inconvenient, at worst really hard, depending of the gap between the parser generator's capabilitie and what your formal langauge specificaiton says.

I suggest you inspect your "Requirement Specification Language" formal grammar, and decide which parser generator you want to use based on that, to minimize the amount of bending you have to do.

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
  • Can you please direct me to couple of best tutorials for it? I am little bit confused. Those tutorial of whole cycle for building compiler will be very useful for me. I just want hint to start. – man19688 Apr 10 '12 at 15:54
  • Which parser will you suggest for this type of specification language. Link of tutorials will be very useful. Appreciate your help. – man19688 Apr 10 '12 at 15:55
  • 1
    You can try: "Compiler Building Tutorial", www.stack.nl/~marcov/compiler.pdf, "Let's Build a Compiler", compilers.iecc.com/crenshaw/. I have no experience with these. You really should get some technical education; see Aho&Ullman book "Compilers: Principles, Techniques, and Tools." Don't expect this to be easy. – Ira Baxter Apr 11 '12 at 14:28