| 1 | /**
|
|---|
| 2 | * This file defines the syntax of CIVL's command line specification.
|
|---|
| 3 | * There are totally 7 commands, namely, compare, gui, help, replay, run, show, and verify.
|
|---|
| 4 | * There are a number of options to be chosen as well.
|
|---|
| 5 | *
|
|---|
| 6 | * The usage of the commands are as follows:
|
|---|
| 7 | * civl compare [option]* -spec [option]* file+ -impl [option]* file+
|
|---|
| 8 | * civl gui (no options needed)
|
|---|
| 9 | * civl help [command]
|
|---|
| 10 | * civl replay [option]* file+ (replay for one program)
|
|---|
| 11 | * civl replay [option]* -spec [option]* file+ -impl [option]* file+
|
|---|
| 12 | * (replay for the comparison of two programs.)
|
|---|
| 13 | * civl run [option]* file+
|
|---|
| 14 | * civl show [option]* file+
|
|---|
| 15 | * civl verify [option]* file+
|
|---|
| 16 | */
|
|---|
| 17 | grammar Command;
|
|---|
| 18 |
|
|---|
| 19 | /* The top-level rule */
|
|---|
| 20 | start
|
|---|
| 21 | :
|
|---|
| 22 | 'help' (REPLAY | COMMAND | 'help')? NEWLINE # help
|
|---|
| 23 | | 'compare' commonOption? specOrImplCommand NEWLINE #compare
|
|---|
| 24 | | (REPLAY | COMMAND) commandBody NEWLINE #normal
|
|---|
| 25 | | REPLAY commonOption? specOrImplCommand NEWLINE #replayCompare
|
|---|
| 26 | ;
|
|---|
| 27 |
|
|---|
| 28 | specOrImplCommand
|
|---|
| 29 | : specCommand implCommand
|
|---|
| 30 | | implCommand specCommand
|
|---|
| 31 | ;
|
|---|
| 32 |
|
|---|
| 33 | commonOption
|
|---|
| 34 | :
|
|---|
| 35 | option+
|
|---|
| 36 | ;
|
|---|
| 37 |
|
|---|
| 38 | specCommand
|
|---|
| 39 | :
|
|---|
| 40 | SPEC commandBody
|
|---|
| 41 | ;
|
|---|
| 42 |
|
|---|
| 43 | implCommand
|
|---|
| 44 | :
|
|---|
| 45 | IMPL commandBody
|
|---|
| 46 | ;
|
|---|
| 47 |
|
|---|
| 48 | commandBody
|
|---|
| 49 | :
|
|---|
| 50 | option* file+
|
|---|
| 51 | ;
|
|---|
| 52 |
|
|---|
| 53 | option
|
|---|
| 54 | :
|
|---|
| 55 | OPTION_NAME ('=' value )? # normalOption
|
|---|
| 56 | | INPUT VAR '=' value # inputOption
|
|---|
| 57 | | MACRO VAR ('=' value)? # macroOption
|
|---|
| 58 | ;
|
|---|
| 59 |
|
|---|
| 60 | file
|
|---|
| 61 | :
|
|---|
| 62 | PATH
|
|---|
| 63 | ;
|
|---|
| 64 |
|
|---|
| 65 | value
|
|---|
| 66 | : BOOLEAN
|
|---|
| 67 | | VAR
|
|---|
| 68 | | NUMBER
|
|---|
| 69 | | PATH
|
|---|
| 70 | ;
|
|---|
| 71 |
|
|---|
| 72 | BOOLEAN
|
|---|
| 73 | : 'true' | 'false'
|
|---|
| 74 | ;
|
|---|
| 75 |
|
|---|
| 76 | NUMBER
|
|---|
| 77 | :
|
|---|
| 78 | [\-\+]?[0-9]+
|
|---|
| 79 | ;
|
|---|
| 80 |
|
|---|
| 81 | SPEC
|
|---|
| 82 | :'-spec'
|
|---|
| 83 | ;
|
|---|
| 84 |
|
|---|
| 85 | IMPL
|
|---|
| 86 | :'-impl'
|
|---|
| 87 | ;
|
|---|
| 88 |
|
|---|
| 89 | INPUT
|
|---|
| 90 | : '-input'
|
|---|
| 91 | ;
|
|---|
| 92 |
|
|---|
| 93 | MACRO
|
|---|
| 94 | : '-D'
|
|---|
| 95 | ;
|
|---|
| 96 |
|
|---|
| 97 | COMMAND:
|
|---|
| 98 | 'verify' | 'run' | 'show' | 'gui'
|
|---|
| 99 | ;
|
|---|
| 100 |
|
|---|
| 101 | REPLAY
|
|---|
| 102 | :
|
|---|
| 103 | 'replay'
|
|---|
| 104 | ;
|
|---|
| 105 |
|
|---|
| 106 | OPTION_NAME
|
|---|
| 107 | :
|
|---|
| 108 | '-ast'
|
|---|
| 109 | | '-collectHeaps'
|
|---|
| 110 | | '-collectProcesses'
|
|---|
| 111 | | '-collectScopes'
|
|---|
| 112 | | '-deadlock'
|
|---|
| 113 | | '-debug'
|
|---|
| 114 | | '-echo'
|
|---|
| 115 | | '-enablePrintf'
|
|---|
| 116 | | '-errorBound'
|
|---|
| 117 | | '-gui'
|
|---|
| 118 | | '-guided'
|
|---|
| 119 | | '-id'
|
|---|
| 120 | | '-maxdepth'
|
|---|
| 121 | | '-min'
|
|---|
| 122 | | '-ompNoSimplify'
|
|---|
| 123 | | '-preproc'
|
|---|
| 124 | | '-random'
|
|---|
| 125 | | '-saveStates'
|
|---|
| 126 | | '-seed'
|
|---|
| 127 | | '-showAmpleSet'
|
|---|
| 128 | | '-showAmpleSetWtStates'
|
|---|
| 129 | | '-showInputs'
|
|---|
| 130 | | '-showModel'
|
|---|
| 131 | | '-showPathCondition'
|
|---|
| 132 | | '-showProgram'
|
|---|
| 133 | | '-showProverQueries'
|
|---|
| 134 | | '-showQueries'
|
|---|
| 135 | | '-showSavedStates'
|
|---|
| 136 | | '-showStates'
|
|---|
| 137 | | '-showTime'
|
|---|
| 138 | | '-showTransitions'
|
|---|
| 139 | | '-simplify'
|
|---|
| 140 | | '-solve'
|
|---|
| 141 | | '-statelessPrintf'
|
|---|
| 142 | | '-svcomp'
|
|---|
| 143 | | '-sysIncludePath'
|
|---|
| 144 | | '-trace'
|
|---|
| 145 | | '-userIncludePath'
|
|---|
| 146 | | '-verbose'
|
|---|
| 147 | | '-web'
|
|---|
| 148 | ;
|
|---|
| 149 |
|
|---|
| 150 | VAR
|
|---|
| 151 | :
|
|---|
| 152 | [_a-zA-Z] [_a-zA-Z0-9]*
|
|---|
| 153 | ;
|
|---|
| 154 |
|
|---|
| 155 | PATH
|
|---|
| 156 | :
|
|---|
| 157 | ([_a-zA-Z0-9\.\/])([_a-zA-Z0-9\-\.\/])*
|
|---|
| 158 | ;
|
|---|
| 159 |
|
|---|
| 160 | NEWLINE
|
|---|
| 161 | : '\r'? '\n'
|
|---|
| 162 | ;
|
|---|
| 163 |
|
|---|
| 164 | /*STRING
|
|---|
| 165 | : ~[ =\-\r\n\t]+;*/
|
|---|
| 166 |
|
|---|
| 167 | WS
|
|---|
| 168 | : [ \t]+ -> skip
|
|---|
| 169 | ;
|
|---|