requirements 1 you need to create two ruby files dot_lexer rb where yo
1. You need to create two ruby files: dot_lexer.rb where you have a DotLexer class that
performs all the token recognition logic and token.rb where you have a Token class
that uses text and type to describe a token. In class DotLexer, you must implement
the method next token that returns recognized tokens. prog2_main.rb is provided.
2. All supported token types are listed below. All other tokens are considered as
Token::INVALID. All token types should be defined in class Token as constants
including the token EOF that indicates the end of file.
3. Invalid characters should be recognized and taken care of. Please refer to the sample
output for "Ca#t" in the sample input to get an idea how to deal with an illegal
4. The name of a node in dot can be an ID, an INT, or a STRING. An ID starts with a
letter followed by letters or digits. An INT contains only digits. A STRING is
recognized by double quotes within which all characters are valid.
5. There are only two keywords: digraph (or DIGRAPH) and subgraph (or SUBGRAPH).
6. For whitespaces, such as ", "\r, \t, and '\n', recognize and skip them without
*The amount will be in form of wallet points that you can redeem to pay upto 10% of the price for any assignment. **Use of solution provided by us for unfair practice like cheating will result in action from our end which may include permanent termination of the defaulter’s account.Disclaimer:The website contains certain images which are not owned by the company/ website. Such images are used for indicative purposes only and is a third-party content. All credits go to its rightful owner including its copyright owner. It is also clarified that the use of any photograph on the website including the use of any photograph of any educational institute/ university is not intended to suggest any association, relationship, or sponsorship whatsoever between the company and the said educational institute/ university. Any such use is for representative purposes only and all intellectual property rights belong to the respective owners.