Lex program to check whether the input is digit or not
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language.
Prerequisite: Flex (Fast lexical Analyzer Generator).
Given an input, the task is to check if the input is digit or not.
Input: 28 Output: digit Input: a Output: not a digit. Input: 21ab Output: not a digit.
Below is the implementation:
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.