VOOZH about

URL: https://www.geeksforgeeks.org/compiler-design/yacc-program-to-recognize-strings-of-anb-n5/

⇱ YACC program to recognize strings of { a<sup>n</sup>b | n&ge;5 } - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

YACC program to recognize strings of { anb | n≥5 }

Last Updated : 7 May, 2019
Problem: Write YACC program to recognize strings of { anb | n≥5 } Explanation: Yacc (for “yet another compiler compiler.”) is the standard parser generator for the Unix operating system. An open source program, yacc generates code for the parser in the C programming language. The acronym is usually rendered in lowercase but is occasionally seen as YACC or Yacc. Examples:
Input: ab
Output: invalid string

Input: aaaaab
Output: valid string

Input: aabb
Output: invalid string

Input: aaaaaaab
Output: valid string

Input: aaaaaabb
Output: invalid string 
Lexical Analyzer Source Code: Parser Source Code: Output: 👁 Image
Comment
Article Tags:

Explore