In Java, for each “language” you will write a separate class that recognizes the language, minimally it MUST contain the
Posted: Fri Apr 29, 2022 7:12 am
In Java, for each “language” you will write a
separate class that recognizes the language,
minimally it MUST contain the following class members:
Language 1: <S>>a<S>c<B> | <A> | b <A> → c<A> | <B> da<A> Each character in this language is a "token" and there are no spaces between tokens, use "toCharArray" to separate the input String into individual tokens Language 2: Simple expression grammar <ASSGN> <ID>= <EXPR> <EXPR> <DIGITID> + <EXPR> | <DIGITID> - <EXPR> | <DIGITID> <DIGITID> <DIGIT> <ID> <DIGIT>>012 ... 9 <ID> > a b c Each "token" in this language will be one character in length, and each token is separated by a space in the test strings. (Use method toCharArray)
separate class that recognizes the language,
minimally it MUST contain the following class members:
Language 1: <S>>a<S>c<B> | <A> | b <A> → c<A> | <B> da<A> Each character in this language is a "token" and there are no spaces between tokens, use "toCharArray" to separate the input String into individual tokens Language 2: Simple expression grammar <ASSGN> <ID>= <EXPR> <EXPR> <DIGITID> + <EXPR> | <DIGITID> - <EXPR> | <DIGITID> <DIGITID> <DIGIT> <ID> <DIGIT>>012 ... 9 <ID> > a b c Each "token" in this language will be one character in length, and each token is separated by a space in the test strings. (Use method toCharArray)