home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,681 of 2,978   
   Marco van de Voort to All   
   Re: BNF notation for Delphi Grammar   
   31 May 05 07:16:10   
   
   From: marcov@stack.nl   
      
   On 2005-05-31, gustgr@gmail.com  wrote:   
      
   You are in the wrong group, this groups is not about delphi. Take a group   
   with "pascal" AND "delphi" in it next time.   
      
   > I starting to write an instrumenter for programs written in Delphi. As   
   > you may know, code instrumentation are language specifics because it   
   > analyzes the program according to the grammar of its language,   
   > recognizes the relevant structures of the program and derives both the   
   > graph and the decorated program upon the semantics of the language.   
   >   
   > Following this approach I need the BNF notation for the Delphi Grammar   
   > (Object Pascal) to write the Yacc and Lex input files to generate the   
   > parser and the lexical analyzer and use them within my instrumentation   
   > program.   
   >   
   > Does anyone know where I can find a complete BNF notation for the   
   > Delphi Grammar?   
      
   There is no complete one, Delphi (including predecessors and clones) are   
   derived from a basically LL(1) language, and use handcrafted recursive   
   descent parsers.   
      
   Most grammars that exist are only pretty printing and syntax highlighting   
   ones, and IMHO not robust enough to e.g. do src2src conversion. This includes   
   the one in some versions of the delphi manual.   
      
   But, do some web searching "delphi grammar", and you would find e.g.   
   http://parserbuilder.sourceforge.net/d6grammar.html which has ties with   
   Coco/R, a name that   
   you will quickly encounter anyway when doing grammar related stuff with Pascal:   
      
   http://www.scifac.ru.ac.za/coco/   
      
   Start there and start searching all related sites.   
      
   There is also an (outdated  commercial one:   
      
   http://www.cocolsoft.com.au/dgram/dgramh.htm   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca