Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • Other

CISS-111 Project 2 Getting Started

Posted on February 8, 2023February 8, 2025 By William Jojo
Uncategorized

(Updated February 8, 2025)

Overview

In case anyone is having trouble getting started, here are a few screenshots of how your environment in IntelliJ must look.

Here is the view with the TokenType enumeration.

Project 2 Layout Showing TokenType

Another view with the main code.

Project 22 Layout Showing Project 2 main code

And a final view with the 6502 test program.

Project 2 Layout Showing program.asm

The Record section of the textbook can be referenced for how records work. However, you only need to create a toString() for this.


The Project

Your entire Project2.java file will be about 60 lines of code or less – half of which has already been provided. This project prepares you for more complex ideas and file layouts. Your project is about writing an EOF loop, splitting up lines, and classifying the components. Each component is placed in the Vector.

When you’ve completed processing the entire file, iterate over the Vector and display each Token. This is the point at which toString() shines.

For the regex portion consider the following:

String n = "#$9A";

if (n.matches("#?\\$\\p{XDigit}{2}(?:\\p{XDigit}{2})?")) {
    // what kind of number is this?
}

The project specs already explain each regex part’s function. The code above shows one of many possible uses for it. Remember that the matches() method only returns true if the String matches the regex.

Post navigation

❮ Previous Post: About Metacognition
Next Post: Write Your Own OS! (BIOS/MBR) ❯

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2025 Programming by Design.