By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,017 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,017 IT Pros & Developers. It's quick & easy.

Need urgent help please.

P: n/a
Dear Friends,

I am struck up with logic. I am using one class(BMSLexer) which takes filename as arugument and the instance of the class is used my another class. example is shown below.

Now my requirement is parser should have a functionality in such a way that parser class should parse the file with the existing lexer funtionality and lexer class should have constructor with no arguments. Nxet when i call from Test calls by instancing the parser then i wil pass filename.

string inputFile = @"C:\test.txt";

System.IO.FileStream fs = new System.IO.FileStream(inputFile, System.IO.FileMode.Open);

Worksoft.Parsers.BMSLexer lexer = new Worksoft.Parsers.BMSLexer(fs);

Worksoft.Parsers.BMSParser parser = new Worksoft.Parsers.BMSParser(lexer);

string test = parser.parse();


--
Thanks & Regards,
P.Srinivasa Dinesh,
Developer,
ECMI.
Internet : sp********@worksoft.com
sr*****************@ecm-i.com
Mobile No: +91-9850607089.
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

You requirement is not clear but it seems not a hard thing??

let me go it this way

"lexer class should have constructor" OK

Worksoft.Parsers.BMSLexer lexer = new Worksoft.Parsers.BMSLexer(); //Fine right???

//If I assume that you need the fs in lexer as well..

lexer.setFileStream(fs);//Fine Right??

//As you said the lexer has some properties so depend on them you call methods in parser right

Worksoft.Parsers.BMSParser parser = new Worksoft.Parsers.BMSParser(lexer);

//I am not sure why you need the file name again here.. but if it is the requirement

string test = parser.parse(inputFile);

So ??? what is the problem??

Nirosh.
"Srinivasa Parupalli" <sp********@worksoft.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
Dear Friends,

I am struck up with logic. I am using one class(BMSLexer) which takes filename as arugument and the instance of the class is used my another class. example is shown below.

Now my requirement is parser should have a functionality in such a way that parser class should parse the file with the existing lexer funtionality and lexer class should have constructor with no arguments. Nxet when i call from Test calls by instancing the parser then i wil pass filename.

string inputFile = @"C:\test.txt";

System.IO.FileStream fs = new System.IO.FileStream(inputFile, System.IO.FileMode.Open);

Worksoft.Parsers.BMSLexer lexer = new Worksoft.Parsers.BMSLexer(fs);

Worksoft.Parsers.BMSParser parser = new Worksoft.Parsers.BMSParser(lexer);

string test = parser.parse();


--
Thanks & Regards,
P.Srinivasa Dinesh,
Developer,
ECMI.
Internet : sp********@worksoft.com
sr*****************@ecm-i.com
Mobile No: +91-9850607089.
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.