This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lisp expression LL(1) grammar: | |
# expr -> "(" operator operands ")" | |
# operator -> "string"|expr | |
# operands -> operand* | |
# operand -> "int"|"float"|"string"|expr | |
#################### lexical analyzer | |
def tokenize(lines): | |
print(f'lexical analyze lines: {lines}') | |
def _tokenize(line): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import urllib2 | |
import json | |
import oauth2 | |
url1 = "https://api.twitter.com/1.1/search/tweets.json" | |
params = { | |
"oauth_version": "1.0", | |
"oauth_nonce": oauth2.generate_nonce(), | |
"oauth_timestamp": int(time.time()) | |
} |