Toy weekend project: make a parser-parser!
This takes in a grammar given in Bakus-Naur Form (BNF),
and a program that was written in the provided grammar,
and produces an image of Syntax Tree using graphviz
.
References:
""" | |
An example of using PyWin32 and the win32com library to interact | |
Microsoft Excel from Python. | |
This can be used instead of Visual Basic for Applications (VBA) | |
(c) Michael Papasimeon | |
""" | |
import win32com.client |
import win32api, win32con, math | |
win32api.Sleep(10000) | |
start_x, start_y = win32api.GetCursorPos() | |
win32api.SetCursorPos((start_x,start_y)) | |
for i in range(0, 320 * 2, 10): | |
x = start_x + int(300 * math.cos(float(i)/100.0)) | |
y = start_y + int(300 * math.sin(float(i)/100.0)) | |
win32api.SetCursorPos((x,y)) |
Function QuickZip(path) | |
'@description: Compress and uncompress zip files. | |
'@author: Jeremy England (SimplyCoded) | |
Dim oFso : Set oFso = CreateObject("Scripting.FileSystemObject") | |
Dim oSap : Set oSap = CreateObject("Shell.Application") | |
Dim oWss : Set oWss = CreateObject("WScript.Shell") | |
Dim isZip, count, root, base, add, out | |
Dim isZipping, isCancelable | |
Const NOT_FOUND = 1 | |
Const NOT_A_ZIP = 2 |
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |