Hello, I recently took a course on assembler/compiler construction. In it we covered parsing algorithms such as LL(n), LR(n), LALR(n), and SLR(n). I understand how these parsing algorithms can be used to determine **if** an input string follows a context free grammar (CFG). At some point I also understood how to tokenize the string using the grammar, however my assignment code is not commented (in hindsight that was a mistake) and I do not understand it anymore. Now I am in need of a parser to convert lines of code into useful tokens and cannot for the life of me …

Member Avatar
Member Avatar
+0 forum 3

My issue is with the "if" statement. Basically I want the program to have proper grammar when it states, "1 [COLOR="red"]hour[/COLOR], 1 [COLOR="red"]minute[/COLOR], 1 [COLOR="red"]second[/COLOR]", instead of "1 [COLOR="red"]hours[/COLOR], 1 [COLOR="red"]minutes[/COLOR], 1 [COLOR="red"]seconds[/COLOR]". See what I mean? I gave it a go with "hours" but with no success. Plus any advice as to how I could've made this program simpler. Keep in mind my knowledge of Java is limited. I'm currently learning it. So please don't bring up advanced methods of making it simpler. I'm limited to a broad knowledge of conditionals and loops (which I vaguely understand). Thank you …

Member Avatar
Member Avatar
+0 forum 4

Prove that L = {a^n: n is a prime number} is not regular I was looking through the solution to it but dont understand it at all, could anyone help explain how to solve it? Thanks

Member Avatar
Member Avatar
+0 forum 1

The End.