INORDER TRAVERSAL If you run the program, you will see the following: printf("If first time ==> morpheme -1 -1\n"); printf("If morpheme selects compl/ext arg ==> morpheme 99 compl/ext arg\n"); printf("If morpheme is selected by head ==> morpheme head 99\n"); printf("If internal merge ==> x head specifier\n"); printf("To traverse in inorder ==> t start -1\n"); To traverse in intorder t start -1 To end control z INPUT?: Please enter three arguments after the prompt 'INPUT?:'. In the first three cases, three arguments are a new morpheme, the head selecting it (if there is one), and the complement/ext argument it selects (if it does). You can start builing a sentence by entering a morpheme, followed by -1 and -1, where -1 means that it has neither a complement/external argument nor a head. 99 in the second and third statements above refers to a new morpheme itself. The fourth statement is internal merge. X means that no new morpheme is added. After building a lexical graph, you can traverse it in postorder by entering t, the starting node and -1. You can generate the sentece 'John will meet Mary' as follows: INPUT?: John -1 -1 (John is the first input) ===Lexical Array Formed So Far=== 0 John (John is associated with the index 0) INPUT?: meet 99 0 (meet is added as the head selecting John(=0)) ===Lexical Array Formed So Far=== 1 meet 0 John ===Syntactic Relations Established So Far=== 1 --> 0 (node 1 (=meet) is related to node 0 (=John)) ===End of List=== INPUT?: Mary 1 99 (Mary is added as the external argument of node 1 (=meet)) ===Lexical Array Formed So Far=== 2 Mary 1 meet 0 John ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 2 ===End of List=== INPUT?: will 99 1 (will is added as the head selecing node 1 (=meet)) ===Lexical Array Formed So Far=== 3 will 2 Mary 1 meet 0 John ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 2 3 --> 1 ===End of List=== INPUT?: x 3 2 (node 3 (=will) and node 2 (=John) are internally merged) ===Lexical Array Formed So Far=== 4 Mary (Mary is copied as node 4 and node 2 is struck out) 3 will 2 -ary 1 meet 0 John ===Syntactic Relations Established So Far=== 1 --> 0 1 --> 4 3 --> 1 3 --> 4 ===End of List=== INPUT?: t 3 -1 (Traverse the lexical graph in inorder with node 3 as the starting node) Inorder Traversal => Mary will meet John