dockerfile.jsf.in (2981B)
1 # Barebones Dockerfile syntax for JOE. Doesn't handle more sophisticated sh syntax. 2 3 =Idle 4 =Command bold 5 =Comment green 6 =Constant cyan 7 =Ident cyan 8 =Escape magenta 9 =Keyword bold 10 =Var bold cyan 11 12 # Start of line is special 13 :start Idle 14 * idle 15 " \t" start 16 "#" comment noeat 17 "A-Za-z" command buffer noeat 18 "\n" start 19 20 # Comments between commands 21 :comment Comment 22 * comment 23 "\n" start 24 25 # Comments in the middle of a command 26 :comment_idle Comment 27 * comment_idle 28 "\n" idle 29 30 # Start of line in the middle of "idle" mode (skips command recognition in case a comment 31 # comes in the middle of a RUN) 32 :start_idle Idle 33 * idle noeat 34 "#" comment_idle recolor=-1 35 36 # Generic middle-of-a-command 37 :idle Idle 38 * idle 39 "$" idle recolor=-1 call=.variable() 40 "\n" start 41 "\\" escape recolor=-1 42 43 :escape Escape 44 * idle recolor=-2 noeat 45 "\\\"" idle 46 "\r" escape 47 "\n" start_idle 48 49 :command Idle 50 * idle noeat istrings 51 "FROM" from 52 "MAINTAINER" string_command 53 "RUN" list_command 54 "CMD" list_command 55 "LABEL" label 56 "EXPOSE" generic_command 57 "ENV" generic_command 58 "ADD" list_command 59 "COPY" list_command 60 "ENTRYPOINT" list_command 61 "VOLUME" list_command 62 "USER" string_command 63 "WORKDIR" string_command 64 "ARG" generic_command 65 "ONBUILD" generic_command 66 "STOPSIGNAL" generic_command 67 done 68 "a-zA-Z" command 69 70 # EXPOSE, ENV, ARG, ONBUILD, STOPSIGNAL 71 :generic_command Command 72 * idle 73 74 # MAINTAINER, USER, WORKDIR 75 :string_command Command 76 * string_command_data 77 78 :string_command_data Ident 79 * string_command_data 80 "$" string_command_data recolor=-1 call=.variable() 81 "\n" start 82 83 # FROM 84 :from Command 85 * from_image noeat 86 87 :from_image Ident 88 * from_image 89 ":@" from_tag noeat 90 "\n" start 91 92 :from_tag Idle 93 * from_tag 94 "\n" start 95 96 # RUN, CMD, ADD, COPY, ENTRYPOINT, VOLUME 97 :list_command Command 98 * idle noeat 99 " \t" list_command 100 "[" array noeat 101 "\n" start 102 103 :array Idle 104 * array 105 "[]" bracket noeat 106 "\"'" array recolor=-1 call=.string() save_c 107 "\n" start 108 109 :comma Idle 110 * array noeat 111 112 :bracket Escape 113 "]" idle 114 "[" array 115 116 # LABEL 117 :label Command 118 * label_key 119 "\n" start 120 121 :label_key Ident 122 * label_key 123 "=" label_value noeat 124 "\n" start 125 126 :label_value Idle 127 * label_value 128 "\"" label_value recolor=-1 call=.string() save_c 129 "\n" start 130 131 .subr variable 132 133 :variable Var 134 * variable recolor=-2 return noeat 135 "A-Za-z_" variable_name 136 "{" variable_long 137 138 :variable_name Var 139 * variable_name return noeat 140 "A-Za-z0-9_" variable_name 141 142 :variable_long Var 143 * variable_long 144 & variable return noeat 145 "\n" variable return noeat 146 "}" variable return 147 ":" variable_after 148 149 :variable_after Idle 150 * variable_after 151 & variable_after return noeat 152 "}" variable_long noeat 153 154 .end 155 156 .subr string 157 158 :string Constant 159 * string 160 & string return 161 "\n" string return noeat 162 "\\" string_escape recolor=-1 163 "$" string recolor=-1 call=.variable() 164 165 :string_escape Escape 166 * string 167 168 .end