flâneur — a map of the web's best reading

Lexical Analysis With Flex, for Flex 2.6.2: Simple Examples

westes.github.io · 466 words · saved by 1 readers

Lexical Analysis With Flex, for Flex 2.6.2: Simple Examples

Lexical Analysis With Flex, for Flex 2.6.2: Simple Examples Next: Format , Previous: Introduction , Up: Top [ Contents ][ Index ] 4 Some Simple Examples First some simple examples to get the flavor of how one uses flex . The following flex input specifies a scanner which, when it encounters the string ' username ' will replace it with the user's login name: %% username printf( "%s", getlogin() ); By default, any text not matched by a flex scanner is copied to the output, so the net effect of this scanner is to copy its input file to its output with each occurrence of ' username ' expanded. In

Explore this link on the map →

related reading