help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Constructing new language


From: sam wun
Subject: Re: Constructing new language
Date: Sun, 13 Feb 2005 23:49:39 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616

Thanks for the guidelines, I will investigate  more about it.

Sam.

Hans Aberg wrote:

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








reply via email to

[Prev in Thread] Current Thread [Next in Thread]