Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use flex option -o (--output=FILE)

Tags:

flex-lexer

I met a problem when trying to flex abcd.l. I wanted to redirect the output to a new file instead of the default one lex.yy.c I looked up it in manual finding an option -o(--output=FILE) so I changed my command to flex xx.l -o lex.yy.1.c but error occurs.

flex: can't open --outfile=lex.yy.1.c
/usr/bin/m4:stdin:2621: ERROR: end of file in string

My working environment is cygwin and windows 7

like image 536
BecomeBetter Avatar asked Aug 25 '15 06:08

BecomeBetter


People also ask

How do you position elements in Flex?

Justify ContentFlex Start positions element at the start of the page. Flex End sets the element to the end of the page. Space Around arranges the items evenly but with spaces between them. The spaces will be equal among all the elements inside a flex-box container, but not outside them.

How do I use flexbox layout?

Align Content To see its effects, you will need more than one row: flex-start: Rows are vertically aligned to the top (i.e., stacked from the top of the wrapper). flex-end: Rows are vertically aligned to the bottom (i.e., stacked from the bottom of the wrapper). center: Rows are centered in the wrapper vertically.


Video Answer


1 Answers

You need to put command line options before positional arguments:

flex -o lex.yy.1.c xx.l

Once a positional (filename) argument is recognized, flex assumes that all following arguments are also filenames. This is the normal form of argument processing for command-line utilities, although some (gcc, for example) allow options to follow the filenames.

(Personally, I'd suggest using a filename like xx.lex.c, but the principle is the same.)

like image 127
rici Avatar answered Oct 29 '22 00:10

rici