top ::= "?"? line | "" line ::= (ident "=")? line | expr expr ::= term (("+" | "-") term)* term ::= fact (("*" | "/") fact)* fact ::= "(" expr ")" | ("+" | "-") fact | number | ident number :::= [0-9]+ ident :::= [a-zA-Z]+ package main import ( "bufio" "errors" "fmt" "os" "strconv" "unicode" ) //位置情報 type SrcInfo struct { Src string Row int Col int } //エラー type ParseError struct { Info SrcInfo Mes
