Problem: Write a Lex program for Decimal to Binary conversion.
FLEX (Fast Lexical Analyzer Generator) is a tool/computer program for generating lexical analyzers (scanners or lexers) written by Vern Paxson in C around 1987. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language. The function yylex() is the main flex function which runs the Rule Section.
Input: 12 Output: 1100 Input: 115 Output: 1110011 Input: 25 Output: 11001 Input: 220 Output: 11011100
- YACC program for Binary to Decimal Conversion
- Lex program for Decimal to Hexadecimal Conversion
- YACC program for Conversion of Infix to Postfix expression
- C program to detect tokens in a C program
- Lex Program to remove comments from C program
- Lex Program For checking a valid URL
- Lex program to check whether a given number is even or odd
- Lex program to identify the identifier
- Lex program to check whether given string is Palindrome or Not
- Lex Program to check whether a number is Prime or Not
- Lex program to find the Length of a String
- Lex program to check if a Date is valid or not
- Lex program to implement a simple Calculator
- Lex program to search a word in a file
- Lex program to check perfect numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.