Subj : Re: Parser generators for a simple language form. How? To : comp.programming From : Jon Ripley Date : Thu Aug 04 2005 10:10 pm Alex Fraser wrote: > "Jon Ripley" wrote: >> Alex Fraser wrote: >>> Which language are the parsers currently implemented in? Are they >>> "hand coded" or did you use a parser generator? >> >> The parsers are currently implemented in 100% hand coded BBC BASIC. >> >> > Have you considered converting them directly to C? I have significant > experience of BBC BASIC and, with the exception of string handling, > I would not normally expect this to be a major problem. A 3rd party > library would simplify the strings aspect - an alternative would be > to use C-ish C++ and std::string. The direct conversion into C was my first thought until I considered that I have multiple languages to create with the same form. This is something that screams out for maximum automation hence the plan to write and then use a compiler-compiler to create the tools. C(ish) C++ looks very reasonable as having string objects available from day one would reduce the development time considerably. Aside from string handling, which comprises a large proportion of the code, the conversion from BBC BASIC to C is relativly simple. Determining how to arrange and code the system will be more complex but still fun. The structure of the compiler-compiler is self-similiar to the tools created using it. The language that the compiler-compiler will be specified in is essentially the same language that the compiler-compiler will use. Conveniently this is also the same language that the generated compilers will expect their input to be written in. After much pondering, I feel that I can achieve maximum possible automation and consequently do the least amount of work creating the entire system from scratch. :'( To code a compiler-compiler-compiler in BBC BASIC to compile the compiler-compiler in language X - to be compiled by another compiler - and then use the compiled compiler-compiler to compile compilable compilers for compilation to be used to compile compilable programs. Thanks, Jon Ripley -- http://jonripley.com/ .