Skip to content

a mini project to validate some basic structures of Swift using python (PLY)

License

Notifications You must be signed in to change notification settings

kavin81/SwiftParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftParser

Description

a mini project to validate some basic structures of Swift built using PLY

features/structures

  • simple data type declaration

    • integer
    • float
    • string
    • boolean
  • array-like data types

    • list
    • tuple
    • set
    • dictionary
  • selection statements

    • if
      • else
      • elif
  • loop statements

    • for
    • while
  • functions declaration

    • with parameters
    • without parameters
    • with return type
    • without return type

Installation

  1. Clone the repository:
    git clone https://github.com/kavin81/SwiftParser
  2. Navigate to the project directory:
    cd SwiftParser
  3. Install dependencies:
    # using pip
    pip install -r requirements.txt
    # using conda/mamba
    conda env create -f environment.yml
    

Usage

>> python main.py --help

usage: script_name.py [-h] [--file FILE | -f FILE]

Parse Swift code from a file.

optional arguments:
    -h, --help            show this help message and exit
    --file FILE, -f FILE  Path to the file containing the Swift code. (default: examples/main.swift)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

a mini project to validate some basic structures of Swift using python (PLY)

Topics

Resources

License

Stars

Watchers

Forks

Languages