integer —> (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) *
• integer -> digit digit* • digit -> 0|1|2|3|4|5|6|7|8|9 • Therefore integer expanded would be • integer -> (0|1|2|3|4|5|6|7|8|9) (0|1|2|3|4|5|6|7|8|9)*
• A number per its regex is either an integer or a real • An integer as shown above is one digit concatenated with zero or more other digits ○ The character '1' is a digit ○ The character 'E' is not a digit therefore 1E-4 is not an integer • A real is an integer concatenated with an exponent or a decimal concatenated with an exponent or the empty string ○ An integer as shown above is one digit concatenated with zero or more other digits ○ An Exponent is the character 'e' or the character 'E' concatenated with the '+' or '-' or empty string concatenated with an integer § the character '1' is an integer and it is concatenated with the string "E-4" which is an exponentTherefore 1E-4 is a real and is therefore a number
integer -> (0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*
A real can be made from an integer and an exponent put together. An exponent can be a 'E' or a 'e' followed by either '-', '+', or 'ε' followed by an integer. E-4 is an exponent since there is an 'E' followed by '-' which is then followed by a 4 which is a digit and an integer. 1 is an integer since it is a digit and E-4 is an exponent. A real is an integer followed by an exponent. Therefore 1E-4 is a number since 1E-4 is real.
Rules used: number -> real real -> integer exponent integer -> digit digit* exponent→(e|E)(+|−|ε)integer digit -> 0|1|2|3|4|5|6|7|8|9