actions before parsing rules in lex n yacc


 
Thread Tools Search this Thread
Top Forums Programming actions before parsing rules in lex n yacc
# 1  
Old 11-26-2008
actions before parsing rules in lex n yacc

Hi ,

We have developed a grammer for our domain language using lex n yacc.
I want to know is there any pre defined lex-yacc function which gets call before executing any rule (or rules).
Oue requirement is, before processing any rule ,we want to perform some specific actions ?
is there any pre defined lex-yacc function which get call before processing rules?

In case of ANTLR (Another Tool for Language Recognition), we can specify actions before processing rule using a block "@init" . Is there anything like "@init" in lex n yacc ?

Regards,
Suprit
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Yacc rogram

hello, actually i want to generate rgram in yacc able to do do several operations separated by ';' and after show all the results separated by ';' again. My code do just one operations and i couldn' t find solution to do several ones separated by ';'. I thought may be i can do a do... while but i... (0 Replies)
Discussion started by: zolafencer
0 Replies

2. Programming

Problem with Yacc

Hi guys, I'm struggling with a simple but at the same time complicated problem related to yacc :wall: Maybe someone can help me with this :confused: I'm working on a big project and it's hard for me to show the problem exactly on my code, but I will give a model of it. Before I had this kind... (2 Replies)
Discussion started by: sisi
2 Replies

3. Programming

parsing fixed length field with yacc/bison

How to specify the token length in a yacc file? sample input format <field1,data type ans,fixed length 6> followed by <field2,data type ans,fixed length 3> Example i/p and o/p Sample Input: "ab* d2 9o" O/p : "Field1 Field2 " yacc/bison grammar: record :... (1 Reply)
Discussion started by: sungita
1 Replies

4. Programming

How to match n number of newline character(\n) in lex and yacc

Hi , I need to develop a parser which should match something like 1. text a=5 " a=20"; 2. text a=..." a=20"; 3 text a=..." a=20 b=34 c=12 "; I have used this regular expression in my Lex file to generate the tokens: \".\s*.*\s.\" (8 Replies)
Discussion started by: vishwa787
8 Replies

5. Programming

regarding lex regular expression

Hi all I am using lex for my application scanning and I need to skip some lines for which I don't know the exact pattern. So, could anybody tell me the regular expression to display lines NOT beginning with the specified pattern. I know how to display lines beginning with the... (1 Reply)
Discussion started by: axes
1 Replies

6. Linux

lex for Chinese character

Hi, I need to read one chinese char using lex. I tried using "." ( period ) for pattern matching but in vain. Could anyone suggest me how do i proceeed. Sample pgm: to read a chinese char in single quotes. %{ #include <locale.h> %} %% \'.\' printf("SUCCESS\n"); . ... (0 Replies)
Discussion started by: suman_jakkula
0 Replies

7. Shell Programming and Scripting

probs compiling lex

this is my lex file ------------ test.l %% printf("%c",yytext+'a'-'A');.ECHO; how do i compile it $ lex test.l cc lex.yy.c -o test -ll <------| | if this is correct do i add this line--------| @the command line or does it... (0 Replies)
Discussion started by: sinner
0 Replies
Login or Register to Ask a Question
YACC(1) 							   User Commands							   YACC(1)

NAME
yacc - GNU Project parser generator SYNOPSIS
yacc [OPTION]... FILE DESCRIPTION
Yacc (Yet Another Compiler Compiler) is a parser generator. This version is a simple wrapper around bison(1). It passes option -y, --yacc to activate the upward compatibility mode. See bison(1) for more information. AUTHOR
Written by Paul Eggert. REPORTING BUGS
Report bugs to <bug-bison@gnu.org>. COPYRIGHT
Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
lex(1), flex(1), bison(1). The full documentation for bison is maintained as a Texinfo manual. If the info and bison programs are properly installed at your site, the command info bison should give you access to the complete manual. GNU Bison 2.4.1 November 2007 YACC(1)