Index of /master/models/eddi2jseden

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[   ]graphbuild.JSE 2013-04-11 01:16 28K 
[TXT]jspenew.js-e 2013-04-09 15:47 6.0K 
[TXT]lexicalAnalysis.txt 2013-04-11 01:32 1.7K 
[TXT]notes 2013-03-27 02:16 281  
[TXT]parsingeddi.txt 2013-04-12 14:26 9.3K 
[   ]run.js-e 2013-12-02 21:17 400  
[TXT]syntaxdirectedtransl..>2013-03-20 03:53 5.9K 
[   ]transitionseddi.eden 2012-10-08 13:08 12K 

html(" JSEden Parsing Model

To load the model, enter(copy and paste)

include(\"models/eddi2jseden/run.js-e\");
into the JS-Eden Interpreter Window.

To set up the model, and give the input a value, you can enter(copy and paste):

graphscale = 0.4;
inputstr = \"(A+BC):width>5 % dim,length\";

JSEden master version allows users to observe different observables. To do this, first click on the Plugins tab on the top of canvas, and then select Symbol Viewer. After that, select the Views tab beside the Plugins tab, and choose the Observable List and Function List. You will see two new windows named Observable List and Function List appear on the canvas. Inside the input box, you can type the names of the observables or regular expressions.

The position and size of windows Observable List and Function List are observables, hence we could control these by assigning values to the observables: For instance, copy and paste the following code

_view_view_1_x=1150;
_view_view_1_y=30;
_view_view_1_width=250;
_view_view_1_height=350;
_view_view_0_x=1150;
_view_view_0_y=450;
_view_view_0_width=250;
_view_view_0_height=350;
into the JS-Eden Intepreter Window.

Here is a list of descriptions of key observables of the model, which you may wish to observe:

currpath - stores the content on the state stack as a list.
currstack - current content on the stack as a list.
stackvals - current content on the value stack as a list.
nextsymbol -represents the look ahead token.
currrule -the number of the grammar rule the parser determines that all the items on the right-hand side of which have been seen(the production by which the parser reduces).
currrstate -current state of the parser(the last element of the currpath, or the top element on the stack state).
InputText -the input string, stays the same all the time.
InputTextt -same as the input string at the beginning, but changes according to the reduction.
k -the index of the current symbol in the InputText(how far we have read in the InputText).
j -the index of the current symbol in the InputTextt(how far we have read in the InputTextt).
The observables k and j are used to control how many tokens the parser has read from the input. The values of k and j are increased by 1 every time the \"Next Step\" button is clicked.

To inspect all of the observables above, you can enter regular expression:

curr|InputT|^k$|^j$|^stackv|^nextsymbol$
into the input window of the Observable List.

The model can be controlled manually. Pressing the button Next Step makes the model to read next token and in order to reduce, first select a corresponding rule and then press the button Apply Rule. The Reset button makes the model to the start state of parsing.

and the model can run automatically, by setting the value of observable isautomatic to be true, For instance:

writeln(isautomatic);
isautomatic=1;
The observable speed determines how fast the model runs automatically, and its current value is 2000. The larger the value of speed is, the slower the model runs.

To inspect the code for the JSEden parsing model, consult the files at

http://jseden.dcs.warwick.ac.uk/master/models/eddi2jseden
The main functions and observables are included in the file parsingeddi.txt. The file transitions.eden stores the information of Eddi Grammar in eden lists. The graphbuild.js-e file uses the graphprototype model, and constructs the interface and visualisation of the parsing model.

");