Sponsored Content
Full Discussion: Problem with Yacc
Top Forums Programming Problem with Yacc Post 302517516 by sisi on Wednesday 27th of April 2011 03:46:08 AM
Old 04-27-2011
Problem with Yacc

Hi guys,

I'm struggling with a simple but at the same time complicated problem related to yacc Smilie Maybe someone can help me with this Smilie
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 of grammar:
Code:
R:
   a1 b1 c1 d1
  |a2 b2 c2 d2
  ;

where a1,....d2 are grammar rules described later.
I have done this kind of change
Code:
R:
  new1 c1 d1
 |new2 c2 d2
 ;

new1:
       a1 b1
       ;

new2:
       a2 b2
       ;

After this I don't get any s/r or r/r errors. Everything seems to work perfect, when I run all tests we have, but I have one fail, which is about finding compilation errors in source code which we try to parse with this yacc parser Smilie Smilie

Please tell me what can be a problem related to my change...it seems to be legal but causes a fail.

Thanks.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies

2. 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

3. Programming

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... (0 Replies)
Discussion started by: supritjain
0 Replies

4. 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

5. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

6. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

7. 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

8. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies
YACC(1) 						      General Commands Manual							   YACC(1)

NAME
Yacc - an LALR(1) parser generator for Java SYNOPSIS
byaccj [ -dlrtvJ ] [ -b prefix ] [-Jclass= classname ] [-Jpackage= package_name ] [-Jextends= extends_name ] [-Jimplements= implements_name ] [-Jsemantic= semantic_type ] [-Jnorun] [-Jnocontruct] [-Jstack= NNN ] [-Jnodebug] [-Jfinal] [-Jthrows= exception_list ] filename DESCRIPTION
Yacc reads the grammar specification in the file filename and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. Yacc normally writes the parse tables and the driver routine to the file y.tab.c. The following options are available: -b prefix The -b option changes the prefix prepended to the output file names to the string denoted by prefix. The default prefix is the character y. -d The -d option causes the header file y.tab.h to be written. -l If the -l option is not specified, yacc will insert The generated code to the user's original code. If the -l option is specified, yacc will not insert the .TP -r The -r option causes yacc to produce separate files for code and tables. The code file is named y.code.c, and the tables file is named y.tab.c. -t The -t option changes the preprocessor directives generated by yacc so that debugging statements will be incorporated in the compiled code. -v The -v option causes a human-readable description of the generated parser to be written to the file y.output. -J The -J option switches from C/C++ to Java output. Not necessary if other -J flags are used. -Jclass=<classname> Changes the name of the Java class (and .java file) to classname -Jpackage=<packagename> Changes the package in which the parser resides from the default <nothing> to packagename -Jextends=<extend_name> Changes the class the parser extends from the default <nothing> to extend_name -Jimplements=<implement_name> Changes the interface the parser implements from the default <nothing> to implement_name -Jsemantic=<semantic_type> Changes the semantic (value of the rules' variables) type to semantic_type. No extra class will be generated. -Jnorun The -Jnorun option informs Byacc to not generate a run() method. Useful when working with threads. -Jnoconstruct The -Jnoconstruct option informs Byacc to not generate constructors. Useful when extending classes. -Jstack=<NNN> Changes the stack size from default 500 to NNN -Jnodebug The -Jnodebug option informs Byacc to omit debugging code for further better performance. -Jfinal The -Jfinal option makes generated class final. -Jthrows=<exception_list> Informs Byacc to declare thrown exceptions for yyparse() method. If the environment variable TMPDIR is set, the string denoted by TMPDIR will be used as the name of the directory where the temporary files are created. FILES
y.code.c y.tab.c y.tab.h y.output /tmp/yacc.aXXXXXX /tmp/yacc.tXXXXXX /tmp/yacc.uXXXXXX DIAGNOSTICS
If there are rules that are never reduced, the number of such rules is reported on standard error. If there are any LALR(1) conflicts, the number of conflicts is reported on standard error. 4.3 Berkeley Distribution July 15, 1990 YACC(1)
All times are GMT -4. The time now is 01:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy