First acceptable solution
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
import triplayacc as yacc
|
||||
import cfg_build
|
||||
import syntax
|
||||
|
||||
from pathlib import Path
|
||||
from graphviz import Source
|
||||
from vistram.tram import *
|
||||
|
||||
import tkinter as tk
|
||||
from vistram.vistram import MachineUI
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.image as mpimg
|
||||
import lib.console as cnsl
|
||||
import os
|
||||
|
||||
from cfg.CFG import CFG
|
||||
from cfg.CFG_Node import (CFG_START, CFG_END)
|
||||
import tkinter as tk
|
||||
from pathlib import Path
|
||||
|
||||
import matplotlib
|
||||
import matplotlib.image as mpimg
|
||||
import matplotlib.pyplot as plt
|
||||
from graphviz import Source
|
||||
|
||||
import lib.console as cnsl
|
||||
import syntax
|
||||
import triplayacc as yacc
|
||||
from cfg.CFG import CFG
|
||||
from vistram.tram import *
|
||||
from vistram.vistram import MachineUI
|
||||
|
||||
matplotlib.use("TkAgg")
|
||||
|
||||
# Assembles the AST into TRAM code
|
||||
@@ -26,14 +22,7 @@ def assemble(ast):
|
||||
return code + [halt()]
|
||||
|
||||
def make_cfg(ast):
|
||||
start = CFG_START()
|
||||
end = CFG_END()
|
||||
|
||||
last = ast.cfa(start, end)
|
||||
if last is not None:
|
||||
last.add_child(end)
|
||||
|
||||
return CFG(start, end, ast)
|
||||
return CFG(ast)
|
||||
|
||||
# Renders a diagram of the AST
|
||||
def render_diagram(dot_string: str):
|
||||
|
||||
Reference in New Issue
Block a user