32 lines
9.1 KiB
XML
32 lines
9.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="478px" preserveAspectRatio="none" style="width:558px;height:478px;background:#FFFFFF;" version="1.1" viewBox="0 0 558 478" width="558px" zoomAndPan="magnify"><defs/><g><ellipse cx="320.5" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="206" x="217.5" y="105.7104"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="186" x="227.5" y="126.8491">get next term from expression</text><polygon fill="#F1F1F1" points="296,159.6792,345,159.6792,357,171.6792,345,183.6792,296,183.6792,284,171.6792,296,159.6792" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="49" x="296" y="175.4873">term is...</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="41" x="243" y="169.085">symbol</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="32" x="357" y="169.085">literal</text><polygon fill="#F1F1F1" points="137,193.6792,257,193.6792,269,205.6792,257,217.6792,137,217.6792,125,205.6792,137,193.6792" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="120" x="137" y="209.4873">symbol in dictionary?</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="14" x="111" y="203.085">no</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="21" x="269" y="203.085">yes</text><rect fill="#FF0000" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="142" x="44" y="227.6792"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="122" x="54" y="248.8179">raise UnknownWord</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="112" x="223" y="227.6792"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="92" x="233" y="248.8179">lookup function</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="122" x="218" y="281.6479"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="102" x="228" y="302.7866">evaluate function</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="148" x="370" y="193.6792"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="128" x="380" y="214.8179">push term onto stack</text><polygon fill="#F1F1F1" points="320.5,325.6167,332.5,337.6167,320.5,349.6167,308.5,337.6167,320.5,325.6167" style="stroke:#181818;stroke-width:0.5;"/><polygon fill="#F1F1F1" points="278,50,363,50,375,62,363,74,278,74,266,62,278,50" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="62" x="324.5" y="84.2104">non-empty</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="85" x="278" y="65.8081">expression is...</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacing" textLength="37" x="229" y="59.4058">empty</text><rect fill="#F1F1F1" height="33.9688" rx="12.5" ry="12.5" style="stroke:#181818;stroke-width:0.5;" width="87" x="277" y="391.6167"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacing" textLength="67" x="287" y="412.7554">normal exit</text><ellipse cx="320.5" cy="456.5854" fill="none" rx="11" ry="11" style="stroke:#222222;stroke-width:1.0;"/><ellipse cx="320.5" cy="456.5854" fill="#222222" rx="6" ry="6" style="stroke:#111111;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="115" x2="115" y1="261.6479" y2="281.6479"/><line style="stroke:#181818;stroke-width:1.0;" x1="115" x2="24" y1="281.6479" y2="281.6479"/><polygon fill="#181818" points="34,277.6479,24,281.6479,34,285.6479,30,281.6479" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="279" x2="279" y1="261.6479" y2="281.6479"/><polygon fill="#181818" points="275,271.6479,279,281.6479,283,271.6479,279,275.6479" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="125" x2="115" y1="205.6792" y2="205.6792"/><line style="stroke:#181818;stroke-width:1.0;" x1="115" x2="115" y1="205.6792" y2="227.6792"/><polygon fill="#181818" points="111,217.6792,115,227.6792,119,217.6792,115,221.6792" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="269" x2="279" y1="205.6792" y2="205.6792"/><line style="stroke:#181818;stroke-width:1.0;" x1="279" x2="279" y1="205.6792" y2="227.6792"/><polygon fill="#181818" points="275,217.6792,279,227.6792,283,217.6792,279,221.6792" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="279" x2="279" y1="315.6167" y2="337.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="279" x2="308.5" y1="337.6167" y2="337.6167"/><polygon fill="#181818" points="298.5,333.6167,308.5,337.6167,298.5,341.6167,302.5,337.6167" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="284" x2="197" y1="171.6792" y2="171.6792"/><line style="stroke:#181818;stroke-width:1.0;" x1="197" x2="197" y1="171.6792" y2="193.6792"/><polygon fill="#181818" points="193,183.6792,197,193.6792,201,183.6792,197,187.6792" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="357" x2="444" y1="171.6792" y2="171.6792"/><line style="stroke:#181818;stroke-width:1.0;" x1="444" x2="444" y1="171.6792" y2="193.6792"/><polygon fill="#181818" points="440,183.6792,444,193.6792,448,183.6792,444,187.6792" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="444" x2="444" y1="227.6479" y2="337.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="444" x2="332.5" y1="337.6167" y2="337.6167"/><polygon fill="#181818" points="342.5,333.6167,332.5,337.6167,342.5,341.6167,338.5,337.6167" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="139.6792" y2="159.6792"/><polygon fill="#181818" points="316.5,149.6792,320.5,159.6792,324.5,149.6792,320.5,153.6792" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="74" y2="105.7104"/><polygon fill="#181818" points="316.5,95.7104,320.5,105.7104,324.5,95.7104,320.5,99.7104" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="349.6167" y2="359.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="532" y1="359.6167" y2="359.6167"/><polygon fill="#181818" points="528,220.2612,532,210.2612,536,220.2612,532,216.2612" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="532" x2="532" y1="62" y2="359.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="532" x2="375" y1="62" y2="62"/><polygon fill="#181818" points="385,58,375,62,385,66,381,62" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="266" x2="24" y1="62" y2="62"/><polygon fill="#181818" points="20,206.2612,24,216.2612,28,206.2612,24,210.2612" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="24" x2="24" y1="62" y2="371.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="24" x2="320.5" y1="371.6167" y2="371.6167"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="371.6167" y2="391.6167"/><polygon fill="#181818" points="316.5,381.6167,320.5,391.6167,324.5,381.6167,320.5,385.6167" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="30" y2="50"/><polygon fill="#181818" points="316.5,40,320.5,50,324.5,40,320.5,44" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="320.5" x2="320.5" y1="425.5854" y2="445.5854"/><polygon fill="#181818" points="316.5,435.5854,320.5,445.5854,324.5,435.5854,320.5,439.5854" style="stroke:#181818;stroke-width:1.0;"/><!--MD5=[ec377fca7e5f6ceacaa83c32e04a919c]
|
|
@startuml
|
|
start
|
|
|
|
while (expression is...) is (non-empty)
|
|
:get next term from expression;
|
|
if (term is...) then (symbol)
|
|
if (symbol in dictionary?) then (no)
|
|
#red:raise UnknownWord;
|
|
break
|
|
else (yes)
|
|
:lookup function;
|
|
:evaluate function;
|
|
endif
|
|
else (literal)
|
|
:push term onto stack;
|
|
endif
|
|
endwhile (empty)
|
|
|
|
:normal exit;
|
|
stop
|
|
@enduml
|
|
|
|
PlantUML version 1.2022.8beta8(Unknown compile time)
|
|
(GPL source distribution)
|
|
Java Runtime: Java(TM) SE Runtime Environment
|
|
JVM: Java HotSpot(TM) 64-Bit Server VM
|
|
Default Encoding: UTF-8
|
|
Language: en
|
|
Country: US
|
|
--></g></svg> |