Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser #8

Closed
wandersonwhcr opened this issue Apr 8, 2017 · 0 comments
Closed

Parser #8

wandersonwhcr opened this issue Apr 8, 2017 · 0 comments

Comments

@wandersonwhcr
Copy link
Owner

wandersonwhcr commented Apr 8, 2017

According issue #6, create a parser that receives as input an array of grammar tokens and outputs an integer representing roman numerals. The tokens will be the output of lexer tokenize method, created at issue #7, but it must not have lexer as dependency.

Also, the parser will be responsible to validate tokens, checking decrescent order. If tokens are not in decrescent order, the parse method must throw an ParserException. Throw this exception if method receive an unknown token, too.

Below, there's a table with tokens and corresponding values.

Token Value
I 1
IV 4
V 5
IX 9
X 10
XL 40
L 50
XC 90
C 100
CD 400
D 500
CM 900
M 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant