problem run and making .jj file
Anyone Knows hoe to make and run java cc (.jj) extension file usnig cmd or vscode or eclipse
4 Replies
⌛
This post has been reserved for your question.
Hey @DigitalDynamo! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Make them: the idea is that you make them. Commands won't
Run them: I would have expected that Google knows, but admittedly it's not very helpful with how to install javacc.
okok
Phase 1:
Lexical Specification part (Regular Expressions of the Tokens )
[Be Creative when you design your language]
• Identify all the basic tokens of your language in Table 1:
o arithmetic operations: addition, subtraction, power ... etc (at least 5)
o relational operations: equality, less than...etc (at least 5)
o logical operators: AND, OR, NOT... etc (at least 4)
o punctuation Marks: colon, semi-colon,....etc (as you need in your language)
o Identifiers
o Digits (integer and float)
o White Spaces: one or more spaces, Tab and new line (it should be discarded)
o Keywords (should be words not symbols. For example: for selection statements
key words use IF or if or If or When )
o Comments
o You can add other tokens as you need.
Phase 2:
• Write the grammar for your language parser using BNF notation in a word file.
o Make sure that your Grammar free of problems such as left recursion and
choice conflicts.
o Your grammar should have these statements:
• Arithmetic statements
• Relational statements
• Logical statements
• Boolean statements
• Conditional statements: if-then, if-then-else
• Two iterative statements such as for, while or do while.
• Variable Declaration: String datatype, Integer datatype and another
datatype from your choice.
• Constants declaration.
• Two data structures of your choice such as list, array.
• Then Convert the grammar into JavaCC using (in jj file).
• The jj code should display “syntactically correct statement” for the correct input
statements. Otherwise, it displays an error message.
• Add some lexical actions to the definition of some tokens or syntactic actions to the
grammar part (at least any 5 actions).
this is my project i have write phase 1 code but I don't know the output pf this code
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.