Skip to content

Instantly share code, notes, and snippets.

@kooooohe
Created September 26, 2019 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kooooohe/bafc9452d3b921a586015d0ce82cb737 to your computer and use it in GitHub Desktop.
Save kooooohe/bafc9452d3b921a586015d0ce82cb737 to your computer and use it in GitHub Desktop.
[Blog][TopDownOperatorPrecedence(再帰下降構文解析)におけるExpression(式)の解析処理を追う] token precedences
var precedences = map[token.TokenType]int{
token.EQ: EQUALS,
token.NOT_EQ: EQUALS,
token.LT: LESSGRETER,
token.GT: LESSGRETER,
token.PLUS: SUM,
token.MINUS: SUM,
token.SLASH: PRODUCT,
token.ASTERISK: PRODUCT,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment