Skip to content

lebuckman/Python-Numerical-Literal-Checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Numerical Literal Checker

A Java-based implementation of a NFA design that recognizes Python numeric literals (decinteger, octinteger, hexinteger, floatnumber) based on Python's 3.14.0 Documentation.

Getting Started

Compile and run the program with the following commands

javac -d out $(find src -name "*.java")
java -cp out Main

Features

After running the program, you will be prompted to either:

  1. Input a string

    Enter test cases individually and see their respective results

  2. Run Test File

    By default, reads tests/in_ans_combined.txt and outputs the results in tests/out_combined.txt.

    To change the input file, please modify line 61: String inputFile = "tests/diff_input.txt";.

Contributions

Group Name: 2-State Machine

Liam Buckman (@lebuckman)

  • Designed JFLAP diagrams for the required integers and floatnumbers: py-floats.jff and py-integers.jff
  • Improved JFLAP diagram of combined required integers and floatnumbers: py-combined.jff
  • Implemented NFA logic in the automata package, containing classes that define a NFA such as its states and transitions
  • Implemented FloatNFA.java that defines the NFA for floatnumbers

Nirwisha Singh (@Nirwisha)

  • Designed JFLAP diagram that combines the required integers and floatnumbers: py-combined.jff
  • Implemented I/O logic in the io package, containing classes that read from a test file and write to a results file
  • Implemented CombinedNFA.java that defines the NFA for both the required integers and floatnumbers
  • Implemented Main.java to provide user interaction with program

About

A Java-based implementation of a NFA design that recognizes Python numeric literals.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages