#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys ops = [ ("(") ,("["), ("."), ("_") ,("^"), ("funcall"), ("!") ,("!!"), ("**"), ("->"), ("::"), (" "), #,("*") ,("⋅") ,("/") ,("&") ,("<<") ,(">>") ,("~"), ("⨯"), ("'"), ("if"), ("++"), ("+") ,("-"), ("%"), ("∩"), ("∪"), ("∈") ,("⊂"), #,("⊃") ,("⊆") ,("⊇"), ("=") ,("/="), ("<"), #,("<=") ,(">") ,(">=") ,("≤") ,("≥"), ("∀") ,("∃"), ("&&"), # ,("∧"), ("||"), # ,("∨"), (","), ("$"), ("elif") ,("else"), ("|"), ("=>"), (";") ,("?;"), (":"), ("from"), ("import") , #("let") ,("let!"), (":="), ("in"), (")") ,("]"), #(""), "1", ] print len(ops) # 46 #sys.exit(1) for a in ops: for b in ops: for c in ops: for d in ops: with open("a.L1","w") as f: f.write("%s%s%s%s" % (a,b,c,d)) os.spawnvp(os.P_WAIT, "./a.out", ["./a.out"]) # TODO compare result with result from a recursive descent parser! # TODO vary length