Creating a.out from yacc.

Creating a.out from yacc.

Post by N » Sat, 14 Jun 2003 21:29:05

I am having a bit of trouble linking my lex and yacc file and creating
an executable. i'll describe what i've done and if someone has an idea
were i went wrong i'd love to hear.
1.lex ll.lex
   created lex.yy.c
2. i then ran yacc on  yc.yacc (which inculded #include "lex.yy.c")
   which created
3. i wrote a main function
int main()
return (yyparse());

4. i then ran
gcc main.c -ll

5. i got a file a.out
6. i did chmod +x a.out
7. now when  i write
a.out <input
i get an answer:
a.out: command not found.




Creating a.out from yacc.

Post by Jim Dabel » Sat, 14 Jun 2003 21:40:36

> a.out: command not found.

Many systems don't include the current directory as part of the path.  Run
it like this:

./a.out < input

(notice the leading ./)

Also, lots of systems include the current directory as part of the path, but
only for non-root users.  Logging in as root to do ordinary tasks is not a
good idea, for all sorts of different reasons (just in case you are doing

Jim Dabell




I'd like to use YACC and LEX twice in an executable. I'd like to read
two different file formats at different times in the program. I link
two objects, each created by yacc. The later object overwrites the
previous definitions.

Is there any way to make the yacc funtions unique?


Concurrent Technologies Corp.
1450 Scalp Avenue                       Phone:  (814) 269-2650
Johnstown, PA 15904                     Fax:    (814) 269-2402

2. Can the Registry Possibly Compete?

3. Where to find a C interpreter created by flex and yacc

4. Character string substitution for multiple files

5. How do I create a.out binaries on an ELF system?

6. 2 WLANs, VPN routing? Is it possible?

7. Elf distribution: I cannot run a.out(ZMAGIC) but a.out(QMAGIC)???

8. How can I turn off the regular expression replacements?

9. YACC Attack -- Please try YACC'ing this.

10. Keeping Track of my Login/outs?csh script

11. Modem lock outs

12. Can apache/stronghold log when a user 'click outs' of your site?

13. Phony Rev Outs Himself was: Aliyah...