Skip to content

Instantly share code, notes, and snippets.

View mystor's full-sized avatar
💥
Breaking Web [===>--------]

Nika Layzell mystor

💥
Breaking Web [===>--------]
View GitHub Profile
@mystor
mystor / parser.py
Created July 26, 2013 19:26
Quick port of [this gist](https://gist.github.com/Mystor/6086481) to Python using PLY
################
# ENTERING LEX #
################
###
# Define Tokens
###
tokens = (
'COURSE',
'RECOMMEND',
@mystor
mystor / grammer.jison
Created July 26, 2013 05:18
Queensu Requirements Grammar Parser
%lex
%%
\s+ /* skip whitespace */
"."|","|";"|":" /* skip punctuation */
[Rr][Ee][Cc][Oo][Mm][Mm][Ee][Nn][Dd]
|[Rr][Ee][Cc][Oo][Mm][Mm][Ee][Nn][Dd][Aa][Tt][Ii][Oo][Nn][Ss]?
return 'RECOMMEND';