1/** 2 * @license 3 * Copyright (C) 2009 Onno Hommes. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18/** 19 * @fileoverview 20 * Registers a language handler for the AGC/AEA Assembly Language as described 21 * at http://virtualagc.googlecode.com 22 * <p> 23 * This file could be used by goodle code to allow syntax highlight for 24 * Virtual AGC SVN repository or if you don't want to commonize 25 * the header for the agc/aea html assembly listing. 26 * 27 * @author ohommes@alumni.cmu.edu 28 */ 29 30PR['registerLangHandler']( 31 PR['createSimpleLexer']( 32 [ 33 // A line comment that starts with ; 34 [PR['PR_COMMENT'], /^#[^\r\n]*/, null, '#'], 35 // Whitespace 36 [PR['PR_PLAIN'], /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'], 37 // A double quoted, possibly multi-line, string. 38 [PR['PR_STRING'], /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"'] 39 ], 40 [ 41 [PR['PR_KEYWORD'], /^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,null], 42 [PR['PR_TYPE'], /^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null], 43 // A single quote possibly followed by a word that optionally ends with 44 // = ! or ?. 45 [PR['PR_LITERAL'], 46 /^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/], 47 // Any word including labels that optionally ends with = ! or ?. 48 [PR['PR_PLAIN'], 49 /^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i], 50 // A printable non-space non-special character 51 [PR['PR_PUNCTUATION'], /^[^\w\t\n\r \xA0()\"\\\';]+/] 52 ]), 53 ['apollo', 'agc', 'aea']); 54