Skip to content

iDevelopThings/go-type-schema-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Schema Parser

A simple parser for a custom schema language, written in Go. This project is inspired by a request from a user, and the code has been generated by the OpenAI's ChatGPT language model.

The legend wrote the code which was almost 90% working, and wrote this readme. 👏

Overview

The custom schema parser can parse schema definitions in the following format:

type User('users') {
    id: ID!
    name: string
    username: string
    someInt: int
    someFloat: float
    someBool: bool
    someDate: date
    someDateTime: datetime
    ids: array<int>
}

The parser is divided into three main components:

  1. main.go: Contains the main() function and data structures to represent the schema.
  2. lexer.go: Tokenizes the input string into a series of tokens.
  3. parser.go: Parses the tokenized input into schema structures.

Usage

  1. Build the parser:
$ go build -o parser

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages