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)
In Java, for each “language” you will write a separate class that recognizes the language, minimally it MUST contain the
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
In Java, for each “language” you will write a separate class that recognizes the language, minimally it MUST contain the
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!