https://github.com/idevelopthings/go-type-schema-parser
https://github.com/idevelopthings/go-type-schema-parser
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/idevelopthings/go-type-schema-parser
- Owner: iDevelopThings
- Created: 2023-04-20T03:39:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T03:40:12.000Z (about 2 years ago)
- Last Synced: 2025-01-30T21:35:47.623Z (4 months ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
}
```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:
```bash
$ go build -o parser
```