MemeScript { Program = Block Block = (Stmnt)+ Stmnt = ConstInit | VarInit | VarDec | FunDec | ObjDec | If | While | For | TryCatch | TryCatchFinally | Switch | Call ";" -- funcall | Assignment ";" -- assign | Return | Print | Error | Alert Body = "{" Block? "}" ConstInit = "overlyattachedgirlfriend.jpg" id "=" Exp ";" VarInit = "ermahgerd" id "=" Exp ";" VarDec = "ermahgerd" id ";" ObjDec = "wow" id "{" ObjConst ObjMethods* "}" ObjConst = "such" "(" Params ")" Body ObjMethods = "so" id "(" Params ")" Body ObjInit = "very" id "(" Args ")" FunDec = "you:" id "(" Params ")" "me, an intellectual:" Body If = "I don't always" "(" Exp ")" "but when I do" Body (ElseIf)* (Else)? ElseIf = "but sometimes I" "(" Exp ")" Body Else = "otherwise I do" Body While = "yo, I'mma let you finish" "(" Exp ")" "but" Body For = "one does not simply" Body "without" "(" VarInit Exp ";" Assignment ")" TryCatch = "Chuck Norris doesn't" Body "he" "(" id ")" Body TryCatchFinally = "Chuck Norris doesn't" Body "or" "(" id ")" Body "he" Body Switch = "this is bill" "(" Exp ")" "{" (SwitchCase)* SwitchDefault "}" SwitchCase = ("bill has a" | "bill is a") Literal "{" Block? "be like bill;" "}" SwitchDefault = "bill is smart" "{" Block? "be like bill;" "}" Return = "i can haz" Exp ";" Print = "dicks.out" "(" Exp ")" ";" Error = "RIP" "(" Exp ")" ";" Alert = "here comes dat boi" "(" Exp ")" ";" Exp = Exp "||" Exp1 -- binary | Exp1 Exp1 = Exp1 "&&" Exp2 -- binary | Exp2 Exp2 = Exp2 relop Exp3 -- binary | Exp3 Exp3 = Exp3 addop Exp4 -- binary | Exp4 Exp4 = Exp4 mulop Exp5 -- binary | Exp5 Exp5 = prefixop Exp6 -- unary | Exp6 Exp6 = Literal | Var | "(" Exp ")" -- parens Literal = "null" -- null | boollit -- bool | ("\"" char* "\"" | "'" char* "'") -- str | (digit* "." digit+) -- float | intlit -- int Assignment = id "=" Exp Call = id "(" Args ")" Args = (Exp ("," Exp)*)? Var = Var "[" Exp "]" -- subscript | Var "." id -- select | Call | ObjInit | id Params = ((OptionalParam | SplatParam | Param) ("," (OptionalParam | SplatParam | Param))*)? Param = id OptionalParam = id "=" Exp SplatParam = id "..." mulop = "*" | "/" | "%" prefixop = "!" | "-" relop = "<=" | "<" | "===" | "==" | "!=" | ">=" | ">" addop = "+" | "-" char = escape | ~"\n" ~"\"" ~"'" any strlit = "\"" char* "\"" | "'" char* "'" intlit = digit+ floatlit = digit* "." digit+ numlit = floatlit | intlit boollit = "true" | "false" escape = "\\n" | "\\\"" | "\\'" keyword = ("you" | "but" | "without" | "ermahgerd" | "he" | "wow" | "such" | "very" | "so" | "much" | "dicks" | "false" | "true" | "null" | "undefined" | "RIP") ~idrest id = ~keyword letter idrest* idrest = "_" | alnum }