Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, January 2007
Qt classes for performing lexical analyis?


Message 1 in thread

Hi All,

 I need to write a program that parses and runs scripts written in a 
specific format.

Do i have to use Lex and Yacc to parse the scripts, or can does Qt offer 
some better mechanism

PS: I need to use Qt 3.x , because i will be integrating the library 
back into KDE 3.5.5'

-- 
 [ signature omitted ] 
begin:vcard
fn:Manish  Chakravarty
n:Chakravarty;Manish 
org:Spike Source ;Solutions Team
adr:100 feet road, Indiranagar;;House #21, 15th Main, HAL 2nd Stage;Bangalore;Karnataka;577204;India
email;internet:manishchaks@xxxxxxxxx
title:Associate Software Developer
tel;work:+919901030104
tel;home:+919901030104
tel;cell:+919901030104
x-mozilla-html:FALSE
url:http://manishchaks.net
version:2.1
end:vcard


Message 2 in thread

On 02.01.07 14:48:59, Manish Chakravarty wrote:
> I need to write a program that parses and runs scripts written in a specific format.
> 
> Do i have to use Lex and Yacc to parse the scripts, or can does Qt offer some better mechanism

Answer to first part is yes, to the 2nd part is no. You may want to try
antlr instead of yacc/lex as IMHO its a bit easier to understand and it
is easier to provide C++ lexing/parsing classes. With Yacc and Lex that
is really not straight forward and as you seem to be writing a library I
don't think global objects are an option.

Andreas

-- 
 [ signature omitted ]