|
From: | Vijayaraghavan Jagannathan |
Subject: | Hi |
Date: | Tue, 23 Oct 2001 18:59:54 +0530 |
Hi all, I have the following requirement. Can anyone suggest
a method by which this can be solved.
A syntax description written
in Bison parses the following synatx.
Section A
statements in
Section A
END;
Section B
statements in
Section B
END;
Section C
statements in
Section C
END;
Section D
statements in
Section D
END;
These four sections in a single
syntax file could be easily parsed by writing a grammar that looks for the
section headers and then parsing the section on the sub-grammar defined for
that.
Consider a following
sequence:
If the Sections are defined in
separate files and are to be combined together to form the input syntax !!! Like
the way we do include header files in C/C++ as given below :
FileName :
"abc.sourcefile"
#include <SECTION A
FILE>
#include <SECTION B
FILE>
#include <SECTION C
FILE>
Section D
statements in
Section D
END;
where
SECTION A FILE is as
follows:
Section A
statements in
Section A
END;
and similarly other files contain
only their sections.
The parsing functionality is an
interface provided via a DLL. i.e. another process will consume this parse
function. The parse function will be called likewise
parse("abc.sourcefile"). The
"abc.sourcefile" is to be opened inside the parser. If it contains
#include statements as above ! how to process them ! If it is a EXE, we
can call CPP32 a C Pre-processor available in windows platform. I want a
solution for DLL.
How to process the #include
directive. If anyone has a solution, please do let me know.
Thanx in advance
JVRN.
Note : I use Visual
Studio 6.0 to compile the C file that is generated by the
parser.
|
[Prev in Thread] | Current Thread | [Next in Thread] |