-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
52 lines (43 loc) · 1.55 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"flag"
"fmt"
"os"
"os/user"
"github.com/Neeraj-Natu/shifu/repl"
)
func main() {
outputPtr := flag.String("output", "lang", "output from lexer, parser or langauge itself")
flag.Parse()
user, err := user.Current()
if err != nil {
panic(err)
}
fmt.Printf(SHIFU)
fmt.Printf("Hello %s! \n",
user.Username)
fmt.Printf("Attain inner peace by exploring the language!! \n")
if *outputPtr == "lexer" {
repl.StartLexer(os.Stdin, os.Stdout)
}
if *outputPtr == "parser" {
repl.StartParser(os.Stdin, os.Stdout)
}
if *outputPtr == "lang" {
repl.StartLang(os.Stdin, os.Stdout)
}
}
const SHIFU = `
_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| ______ __ __ __________ __________ ___ ___ |
| / ____| | | | | |___ ___| | _______| | | | | |
| | | | | | | | | | | | | | | |
| | |___ | |____| | | | | |____ | | | | |
| \____ \ | ____ | | | | ____| | | | | |
| | | | | | | | | | | | | | | |
| _____| | | | | | ___| |___ | | | |____| | |
| |______ / |__| |__| |__________| |___| \__________/ |
| |
| Programming Language |
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __|
`