First note that this is the help list of Bison, and that Bison is a program
different from Yacc. Bison is also normally used with Flex, and the latter
is a program different from Lex. And Perl isn't GNU. So you won't get much
help here. Help-flex mailing list:
address@hidden
http://mail.gnu.org/mailman/listinfo/help-flex
You question is probably better fitted for the newsgroup comp.compilers, or
perhaps some sysop newsgroup.
Suppose you have Bison/Flex setup. Then one would probably implement USERS,
FILE, etc as tokens: Make a lookup table, and when the lexer sees an
identifier, let it check in the lookup table what token type it is, and
return that value. You must then have a way to enter identifiers onto the
lookup table. If that is done via your language, then you need some
definition clauses, for example:
%token file_key "file"
...
%%
...
definition:
"file" NAME { put string of $2 onto lookup table }
You can a similar extensibility of the RUNNING_PROC, if each value httpd
etc. is associated with a function pointer, the latter which is put as
semantic value on the lookup table.
At 01:40 +0800 2005/02/12, sam wun wrote:
Hi,
I would like to consturct a new language to describe the standard
configuration of the workstations and servers for my company's network.
This will help administrator quickly identify mis-configuration of all
1000 workstations and servers.
Here is what I would like to write:
SYSTEM : id USERS APPS type space FILE
USERS : bob sam cindy jenny john ken ...
APPS : RUNNING_PROC
RUNNING_PROC : httpd qmail sshd squid ...
FILE : slash_root user_root usr var home opt
slash_root : boot kernel.sys loader.conf device.hints ...
user_root : dot_cshrc dot_profile dot_ssh ...
usr : bin local lib libexec sbin var opt ...
var : db crash named run spool state lib ...
....
Then use yacc/lex generate parser in perl, then use these information to
further develop applicaiton to monitor configuration of all machines.
Are these possible to be a solution to monitor the configuration of all
machines?
Thanks
Sam
_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison