Top "Lexical-analysis" questions

Process of converting a sequence of characters into a sequence of tokens.

Tips for creating "Context Free Grammar"

I am new to CFG's, Can someone give me tips in creating CFG that generates some language For example L = {…

grammar context-free-grammar lexical-analysis formal-languages
yylval and union

What is the purpose of union in the yacc file? Is it directly related to yylval in the flex file? …

parsing yacc bison lexical-analysis
premature eof error in flex file

I have the following code and it gives an error" "hello.l",line 31: premature EOF" when I run the following …

c bison lexical-analysis flex-lexer
How to use yylval with strings in yacc

I want to pass the actual string of a token. If I have a token called ID, then I want …

yacc bison lexical-analysis
How do i implement If statement in Flex/bison

I dont get the error, please can you help me out, here is the .l and .y file.thanks. %{ #include "…

c++ yacc bison lexical-analysis
What is a regular expression for control characters?

I'm trying to match a control character in the form \^c where c is any valid character for control characters. …

java regex ascii lexical-analysis
Installing flex (lexical analyzer) on Mac

Can someone tell me how I can install flex (lexical analyzer) on my Mac? I searched everywhere on google and …

c macos flex-lexer lexical-analysis
Python regular expressions - how to capture multiple groups from a wildcard expression?

I have a Python regular expression that contains a group which can occur zero or many times - but when …

python regex lexical-analysis
What is the meaning of yytext[0]?

What is the meaning of yytext[0]? And why should we use in the lex and yacc program? I'm learner so …

yacc flex-lexer lexical-analysis
What's the difference between a parser and a scanner?

I already made a scanner, now I'm supposed to make a parser. What's the difference?

parsing yacc lexical-analysis