Annotation of capa/capa51/pProj/lexical.doc, revision 1.1.1.1

1.1       albertel    1: 
                      2: In the begining of a quizz file, the lexxer places itself in 
                      3: <S_TEXT> state. This is the default state that collects all question 
                      4: text problem by problem. 
                      5: 
                      6: 
                      7: 
                      8: In <S_TEXT> state, where question text are collected in this state, 
                      9: the question text can continued to the next line by combining the two
                     10: symbols '\' followed by a '\n'. 
                     11: Variables can be displayed within "/DIS()" function. 
                     12: 
                     13: Within the <S_TEXT> state, begin of a line '/' commands 
                     14: include "//", "/LET", "/BEG", "/HIN", "/EXP", "/IMP", 
                     15: "/END", "/END()", "/ANS", "/MAP". 
                     16: The "/DIS()" command can be placed within anyplace of the problem text,
                     17: therefore, the pattern is not limited to match the begin of a line symbol '^'.
                     18: A single "\n" indicates the end of a paragraph of question text, 
                     19: therefore, lexxer returns this symbol to parser so that it signals the
                     20: end of q_text. The "\n" will showup in the final question text. 
                     21: The pattern "\"{Space}*"\n" represents the continuation of question text
                     22: to the next line. In the lexxer, it simply does nothing. 
                     23: 
                     24: The token "//" appears at the beginning of a line indicates the whole 
                     25: line as a comment. This is treated only by lexxer, it did not
                     26: report any token to parser().
                     27: The token "/LET" will 
                     28: 
                     29: 
                     30: 
                     31: 
                     32: 
                     33: When encountered a ^/ANS token, it switched to <S_ANSWER> state. 
                     34: In <S_ANSWER> state, {Spaces}+ are ignored within the lexxer 
                     35: without returning anything to parser, 
                     36: and 
                     37: a single '(' will cause Pcount++ and return token '(' to parser. 
                     38: 
                     39: <S_VARIABLE,S_LET,S_ANSWER,S_MAP> 
                     40: is a combined state that does the following thing. 
                     41: It ignores spaces. 
                     42: When encountered a '(', it executes Pcount++ and return this symbol 
                     43: to parser. 
                     44: When there is a integer constant could be collected, it 
                     45: returns a I_CONSTANT to parser and convert the string to integer. 
                     46: When a real number encountered, it converts it into a real number and
                     47: returns R_CONSTANT to parser. 
                     48: When it encountered an identifier, it calls 
                     49: find_identifier() and returns IDENTIFIER to parser().
                     50: When it encountered a identifier followed by a 
                     51: '(', then it simply collects the identifier to 
                     52: a string and places it on top of the FuncStack[]. 
                     53: It then returns FUNCTION_ID to parser().
                     54: 
                     55: 
                     56: /IMP "/absolute/path/to/file" and 
                     57: /IMP VariableName  have to be in one line, 
                     58: it cannot be broken down into several lines
                     59: 
                     60: 
                     61: 
                     62: TO DO:
                     63:   Internal variable names such as SUBJECTIVE[123][ABC]
                     64:   
                     65:   Add supports for loops like
                     66: 
                     67:   /LET var2 = random(1,9,1)
                     68:   /WHILE ( var2 <= 10  )
                     69:   
                     70:   /LET problem_name = "file" + var2
                     71:   /IMP problem_name
                     72:   /LET var2 = var2 + 1
                     73:   /ENDWHILE 
                     74: 
                     75:   /ANS() /AND
                     76:   /ANS() /AND
                     77:   /ANS()
                     78: 
                     79:   /ANS() /OR
                     80:   /ANS() /OR
                     81:   /ANS()
                     82: 
                     83:   /IF (var1 == 0)  
                     84:          
                     85:   /ELSE   
                     86:     
                     87:   /ENDIF
                     88:   
                     89:   /MACRO   macro_name(#1,#2,#3)   /ENDM
                     90:   
                     91:   
                     92:   
                     93: FILE FORMATS under CLASS/records/ directory
                     94: active.log
                     95:   wabash002 , 0 , 11242 , /dev/ttyp6 ,(06/11/97 15:13:40)
                     96:   ^^^^^^^^^
                     97:   9 chars student id
                     98:   a space char, a comma, a space char, a comma, process id, a comma, term, date time.
                     99:   
                    100:   One student has only one entry in this file. 
                    101: 
                    102: duration.log
                    103: 
                    104: meisels01       /dev/ttyp3      Tue May 20 14:05:59 1997        Tue May 20 14:06:11 1997
                    105: 173336318       /dev/ttyp1      Fri May 30 18:35:22 1997        Fri May 30 18:39:28 1997
                    106: 173336318       /dev/ttyp1      Fri May 30 18:39:53 1997        Fri May 30 18:42:41 1997
                    107: 
                    108: student id, tty, start from , logout time. 
                    109: One session has one entry. 
                    110: 
                    111: setX.db
                    112: 20,01/01/97 08:00,05/15/99 08:00,05/15/99 09:00
                    113: 11111111212113311222
                    114: 00000000000000000000
                    115: calcutta3 --------------------, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    116: calcutta2 --------------------, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
                    117: 
                    118: the first item is the number of problems in this set for the purpose of parsing. 
                    119: The second line is the problem weight and the third line is whether the corresponding 
                    120: problem is of type partial credit or not. 
                    121: 
                    122: 
                    123: logX.db
                    124: a73336319 Fri Feb 27 18:03:15 1998 --------------Y-----
                    125: a73336319 Fri Feb 27 18:04:08 1998 -----------------N--
                    126: a73336319 Fri Feb 27 18:04:18 1998 -----------------Y--
                    127: a87654444 Sat Feb 28 18:48:46 1998 ---u----------------
                    128: a43986495 Wed Mar  4 09:48:33 1998 Y-------------------
                    129: 
                    130: weblogX.db
                    131: 
                    132: a87654322 Fri Feb 27 18:57:51 1998 ---u----------------
                    133: a87654322 Fri Feb 27 19:35:57 1998 N-------------------
                    134: a87654322 Fri Feb 27 19:36:06 1998 N-------------------
                    135: a87654322 Fri Feb 27 19:36:16 1998 Y-------------------
                    136: a87654444 Sat Feb 28 18:46:37 1998 N-------------------
                    137: a73336318 Sun Mar  1 20:21:42 1998 -u------------------
                    138: a73336318 Sun Mar  1 20:21:54 1998 -N------------------
                    139: a73336318 Sun Mar  1 20:22:35 1998 -Y------------------
                    140: a73336318 Sun Mar  1 20:23:49 1998 --U-----------------
                    141: 
                    142: 
                    143: 
                    144: submissionsX.db
                    145: 
                    146: A12345678       24/02 09:55:24  6       safsdf
                    147: a73336318       26/02 13:26:17  2       46.6
                    148: a73336318       26/02 13:28:24  2       46.4
                    149: a73336318       26/02 13:28:40  2       46.6 cm
                    150: a73336318       26/02 13:31:35  2       46.6
                    151: a73336318       26/02 13:31:47  1       aedf
                    152: a73336318       26/02 13:32:30  3       40.6 m
                    153: guesta007       25/02 21:43:32  1       xcb
                    154: a73336319       27/02 17:38:53  1       cdef
                    155: a73336319       27/02 17:39:13  2       39.8 
                    156: a73336319       27/02 17:39:22  2       39.8 m
                    157: a73336319       27/02 17:39:47  2       .398 J/N
                    158: 
                    159: 
                    160: websubmissionsX.db
                    161: 
                    162: a73336318       26/02 13:28:40  2       46.6 cm
                    163: a73336318       26/02 13:31:35  2       46.6
                    164: a73336318       26/02 13:31:47  1       aedf
                    165: a73336318       26/02 13:32:30  3       40.6 m
                    166: a73336318       26/02 13:32:44  3       40.6 kg
                    167: a73336318       26/02 13:33:05  3       406 mm
                    168: a73336318       26/02 13:33:32  4       .332 J/N
                    169: a73336318       26/02 13:33:52  5       53.0 cm
                    170: a73336318       26/02 13:34:13  5       53.01 cm
                    171: a73336318       26/02 13:34:37  5       52.99 cm
                    172: a73336318       26/02 13:34:49  5       52,995 cm
                    173: a73336318       26/02 13:35:12  5       52.995 cm
                    174: a73336318       26/02 13:38:06  5       53.00 cm
                    175: a73336318       26/02 13:38:34  6       6.060
                    176: a73336318       26/02 13:38:55  6       60.6
                    177: a73336318       26/02 13:39:17  7       .97 m^2
                    178: a73336318       26/02 13:39:33  7       .0097 m^2
                    179: a73336318       26/02 13:42:51  8       1.99E3 cm^3
                    180: 
                    181: 
                    182: 
                    183: 
                    184: subjective answers
                    185: records/subj/ansX.db
                    186: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>