==================================================================== Task 1: Single Digit Binary Build a grammar that accepts exactly one binary digit, either 0 or 1. ::= "0" | "1" ==================================================================== Task 2: Binary Strings (Non-empty) Build a grammar that accepts any non-empty binary string. ::= | ::= "0" | "1" ==================================================================== Task 3: Even Number of a Characters Build a grammar over {a,b} where the count of a is even. ::= ε | "b" | "a" ::= "b" | "a" ==================================================================== Task 4: Identifier Names Build a grammar for identifiers that start with a letter, followed by letters or digits. ::= ::= ε | | ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 5: Unsigned Integer Build a grammar for unsigned base-10 integers with no sign. ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 6: Simple Arithmetic (Plus Only) Build a grammar that accepts numbers joined by +, for example 1+2+3, with no spaces. ::= | "+" ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 7: Matched Parentheses Build a grammar that accepts correctly balanced parentheses using only ( and ). ::= ε | | "(" ")" ==================================================================== Task 8: Comma-Separated Integer List Build a grammar for one or more integers separated by commas, with no trailing comma. ::= | "," ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 9: Binary Multiples of 2 Build a grammar for binary integers that are multiples of 2 (so the last bit must be 0). ::= "0" ::= ε | ::= "0" | "1" ==================================================================== Task 10: Signed Decimal Number Build a grammar for signed decimal numbers: optional + or -, digits, and optional fractional part. ::= ::= ε | "+" | "-" ::= ε | "." ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 11: Mini Expression Parser Build a grammar for arithmetic expressions supporting unsigned integers, addition (+), multiplication (*), parentheses, correct operator precedence (examine the parse tree to check) and left associativity (2+3+4 should be parsed as (2+3)+4 and not 2+(3+4) ) ::= ::= ε | "+" | "-" ::= ε | "." ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ==================================================================== Task 12: Email address Build a grammar that accepts valid email addresses. ::= "@" ::= | ::= | | "." | "_" ::=