Added: uima/sandbox/ruta/trunk/ruta-ep-ide/schema/stringFunctionExtension.exsd URL: http://svn.apache.org/viewvc/uima/sandbox/ruta/trunk/ruta-ep-ide/schema/stringFunctionExtension.exsd?rev=1504044&view=auto ============================================================================== --- uima/sandbox/ruta/trunk/ruta-ep-ide/schema/stringFunctionExtension.exsd (added) +++ uima/sandbox/ruta/trunk/ruta-ep-ide/schema/stringFunctionExtension.exsd Wed Jul 17 08:23:15 2013 @@ -0,0 +1,130 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<schema targetNamespace="org.apache.uima.ruta.ide" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.apache.uima.ruta.ide" id="stringFunctionExtension" name="stringFunctionExtension"/> + </appinfo> + <documentation> + [Enter description of this extension point.] + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appinfo> + <meta.element /> + </appinfo> + </annotation> + <complexType> + <sequence minOccurs="1" maxOccurs="unbounded"> + <element ref="stringFunction"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute translatable="true"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="stringFunction"> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.apache.uima.ruta.ide.core.extensions.IIDEActionExtension"/> + </appinfo> + </annotation> + </attribute> + <attribute name="engine" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.apache.uima.ruta.extensions.IRutaActionExtension"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appinfo> + <meta.section type="since"/> + </appinfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="examples"/> + </appinfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="apiinfo"/> + </appinfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="implementation"/> + </appinfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema>
Added: uima/sandbox/ruta/trunk/ruta-ep-ide/schema/typeFunctionExtension.exsd URL: http://svn.apache.org/viewvc/uima/sandbox/ruta/trunk/ruta-ep-ide/schema/typeFunctionExtension.exsd?rev=1504044&view=auto ============================================================================== --- uima/sandbox/ruta/trunk/ruta-ep-ide/schema/typeFunctionExtension.exsd (added) +++ uima/sandbox/ruta/trunk/ruta-ep-ide/schema/typeFunctionExtension.exsd Wed Jul 17 08:23:15 2013 @@ -0,0 +1,130 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<schema targetNamespace="org.apache.uima.ruta.ide" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.apache.uima.ruta.ide" id="typeFunctionExtension" name="typeFunctionExtension"/> + </appinfo> + <documentation> + [Enter description of this extension point.] + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appinfo> + <meta.element /> + </appinfo> + </annotation> + <complexType> + <sequence minOccurs="1" maxOccurs="unbounded"> + <element ref="typeFunction"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute translatable="true"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="typeFunction"> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.apache.uima.ruta.ide.core.extensions.IIDEActionExtension"/> + </appinfo> + </annotation> + </attribute> + <attribute name="engine" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.apache.uima.ruta.extensions.IRutaActionExtension"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appinfo> + <meta.section type="since"/> + </appinfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="examples"/> + </appinfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="apiinfo"/> + </appinfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="implementation"/> + </appinfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> Added: uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g URL: http://svn.apache.org/viewvc/uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g?rev=1504044&view=auto ============================================================================== --- uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g (added) +++ uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g Wed Jul 17 08:23:15 2013 @@ -0,0 +1,538 @@ +lexer grammar RutaLexer; +options { + language = Java; +} + + +tokens { + DocComment; + Annotation; + ListIdentifier; +} + +@lexer::header { +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. +*/ + +package org.apache.uima.ruta.ide.core.parser; +} + +@lexer::members { + public int implicitLineJoiningLevel = 0; + public int startPos=-1; + public void emitErrorMessage(String msg) { + } +} + + +TRIE + : 'TRIE' + ; + +CONTAINS + : 'CONTAINS' + ; + +DECLARE + : 'DECLARE' + ; + +WORDLIST + : 'WORDLIST' + ; + +WORDTABLE + : 'WORDTABLE' + ; + +AND + : 'AND' + ; + +CONTEXTCOUNT + : 'CONTEXTCOUNT' + ; + +COUNT + : 'COUNT' + ; + +TOTALCOUNT + : 'TOTALCOUNT' + ; + +CURRENTCOUNT + : 'CURRENTCOUNT' + ; + +INLIST + : 'INLIST' + ; + + +LAST + : 'LAST' + ; + +MOFN + : 'MOFN' + ; + +NEAR + : 'NEAR' + ; + +OR + : 'OR' + ; + +PARTOF + : 'PARTOF' + ; + +PARTOFNEQ + : 'PARTOFNEQ' + ; + +POSITION + : 'POSITION' + ; + +REGEXP + : 'REGEXP' + ; + +SCORE + : 'SCORE' + ; + +VOTE + : 'VOTE' + ; + +IF + : 'IF' + ; + +FEATURE + : 'FEATURE' + ; + +PARSE + : 'PARSE' + ; + +CREATE + : 'CREATE' + ; + +GATHER + : 'GATHER' + ; + +FILL + : 'FILL' + ; + +ATTRIBUTE + : 'ATTRIBUTE' + ; + +COLOR + : 'COLOR' + ; + +DEL + : 'DEL' + ; + +LOG + : 'LOG' + ; + +MARK + : 'MARK' + ; + +MARKSCORE + : 'MARKSCORE' + ; + +MARKONCE + : 'MARKONCE' + ; + +MARKFAST + : 'MARKFAST' + ; + +MARKTABLE + : 'MARKTABLE' + ; + +MARKLAST + : 'MARKLAST' + ; + +REPLACE + : 'REPLACE' + ; + +RETAINTYPE + : 'RETAINTYPE' + ; + +FILTERTYPE + : 'FILTERTYPE' + ; + +CALL + : 'CALL' + ; + + +EXEC + : 'EXEC' + ; + +CONFIGURE + : 'CONFIGURE' + ; + +ASSIGN + : 'ASSIGN' + ; + +SETFEATURE + : 'SETFEATURE' + ; + +GETFEATURE + : 'GETFEATURE' + ; + +UNMARK + : 'UNMARK' + ; + +UNMARKALL + : 'UNMARKALL' + ; + +TRANSFER + : 'TRANSFER' + ; + + +SHIFT + : 'SHIFT' + ; + +DYNAMICANCHORING + : 'DYNAMICANCHORING' + ; + +TRIM + : 'TRIM' + ; + +BEFORE + : 'BEFORE' + ; + +AFTER + : 'AFTER' + ; + +IS + : 'IS' + ; + + +STARTSWITH + : 'STARTSWITH' + ; + +ENDSWITH + : 'ENDSWITH' + ; + +ADDRETAINTYPE + : 'ADDRETAINTYPE' + ; + +REMOVERETAINTYPE + : 'REMOVERETAINTYPE' + ; + +ADDFILTERTYPE + : 'ADDFILTERTYPE' + ; + +REMOVEFILTERTYPE + : 'REMOVEFILTERTYPE' + ; + +NOT + : 'NOT' + ; + +ADD : 'ADD'; +REMOVE : 'REMOVE'; +REMOVEDUPLICATE : 'REMOVEDUPLICATE'; +MERGE : 'MERGE'; +GET : 'GET'; +GETLIST : 'GETLIST'; +SIZE : 'SIZE'; +MATCHEDTEXT : 'MATCHEDTEXT'; +REMOVESTRING : 'REMOVESTRING'; +CLEAR : 'CLEAR'; + +THEN + : '->' + ; + + +LogLevel: + 'finest' | 'finer' | 'fine' | 'config' | 'info' | 'warning' | 'severe' + ; + +OldColor + : 'black' | 'maroon' | 'green' | 'olive' | 'navy' | 'purple' | 'teal' | 'gray' | 'silver' | 'red' | 'lime' | 'yellow' | 'blue' | 'fuchsia' | 'aqua' + ; + +PackageString : 'PACKAGE'; +ScriptString : 'SCRIPT'; +EngineString : 'ENGINE'; +UimafitString : 'UIMAFIT'; +BlockString : 'BLOCK'; +AutomataBlockString : 'RULES'; +TypeString : 'TYPE'; +IntString : 'INT'; +DoubleString : 'DOUBLE'; +FloatString : 'FLOAT'; +StringString : 'STRING'; +BooleanString : 'BOOLEAN'; +TypeSystemString: 'TYPESYSTEM'; +SymbolString : 'SYMBOL'; +CONDITION : 'CONDITION'; +ACTION : 'ACTION'; +BOOLEANLIST + : 'BOOLEANLIST'; +INTLIST : 'INTLIST'; +DOUBLELIST + : 'DOUBLELIST'; +FLOATLIST + : 'FLOATLIST'; +STRINGLIST + : 'STRINGLIST'; +TYPELIST: 'TYPELIST'; + + + +EXP : 'EXP'; +LOGN : 'LOGN'; +SIN : 'SIN'; +COS : 'COS'; +TAN : 'TAN'; +XOR : 'XOR'; +TRUE : 'true'; +FALSE : 'false'; + +STARTANCHOR + : '@'; + +HexLiteral : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ; + +DecimalLiteral : ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix? ; + +OctalLiteral : '0' ('0'..'7')+ IntegerTypeSuffix? ; + +fragment +HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ; + +fragment +IntegerTypeSuffix : ('l'|'L') ; + +FloatingPointLiteral + : ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix? + | '.' ('0'..'9')+ Exponent? FloatTypeSuffix? + //| ('0'..'9')+ Exponent FloatTypeSuffix? + //| ('0'..'9')+ Exponent? FloatTypeSuffix + ; + +fragment +Exponent : ('e'|'E') ('+'|'-')? ('0'..'9')+ ; + +fragment +FloatTypeSuffix : ('f'|'F'|'d'|'D') ; + +CharacterLiteral + : '\'' ( EscapeSequence | ~('\''|'\\') ) '\'' + ; + +StringLiteral + : '"' ( EscapeSequence | ~('\\'|'"') )* '"' + ; + +RessourceLiteral + : '\'' ( EscapeSequence | ~('\\'|'\'') )* '\'' + ; + +fragment +EscapeSequence + : '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') + | UnicodeEscape + | OctalEscape + ; + +fragment +OctalEscape + : '\\' ('0'..'3') ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') ('0'..'7') + | '\\' ('0'..'7') + ; + +fragment +UnicodeEscape + : '\\' 'u' HexDigit HexDigit HexDigit HexDigit + ; + + +Identifier + : Letter (Letter|JavaIDDigit)* + ; + + +fragment +Letter + : '\u0024' | + '\u0041'..'\u005a' | + '\u005f' | + '\u0061'..'\u007a' | + '\u00c0'..'\u00d6' | + '\u00d8'..'\u00f6' | + '\u00f8'..'\u00ff' | + '\u0100'..'\u1fff' | + '\u3040'..'\u318f' | + '\u3300'..'\u337f' | + '\u3400'..'\u3d2d' | + '\u4e00'..'\u9fff' | + '\uf900'..'\ufaff' + ; + +fragment +JavaIDDigit + : '\u0030'..'\u0039' | + '\u0660'..'\u0669' | + '\u06f0'..'\u06f9' | + '\u0966'..'\u096f' | + '\u09e6'..'\u09ef' | + '\u0a66'..'\u0a6f' | + '\u0ae6'..'\u0aef' | + '\u0b66'..'\u0b6f' | + '\u0be7'..'\u0bef' | + '\u0c66'..'\u0c6f' | + '\u0ce6'..'\u0cef' | + '\u0d66'..'\u0d6f' | + '\u0e50'..'\u0e59' | + '\u0ed0'..'\u0ed9' | + '\u1040'..'\u1049' + ; + + + +LPAREN : '(' {implicitLineJoiningLevel++;} ; + +RPAREN : ')' {implicitLineJoiningLevel--;} ; + +LBRACK : '[' {implicitLineJoiningLevel++;} ; + +RBRACK : ']' {implicitLineJoiningLevel--;} ; + +LCURLY : '{' {implicitLineJoiningLevel++;} ; + +RCURLY : '}' {implicitLineJoiningLevel--;} ; + +CIRCUMFLEX : '^' ; + +DOT : '.' ; + +COLON : ':' ; + +COMMA : ',' ; + +SEMI : ';' ; + +PLUS : '+' ; + +MINUS : '-' ; + +STAR : '*' ; + +SLASH : '/' ; + +VBAR : '|' ; + +AMPER : '&' ; + +LESS : '<' ; + +GREATER : '>' ; + +ASSIGN_EQUAL : '=' ; + +PERCENT : '%' ; + +QUESTION : '?' ; + +EQUAL : '==' ; + +NOTEQUAL : '!=' ; + +ALT_NOTEQUAL: '<>' ; + +LESSEQUAL : '<=' ; + + +GREATEREQUAL : '>=' ; + + +WILDCARD : '#' ; + +WS : (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;} + ; + + + + + + + +COMMENT + : '/*'{if (input.LA(1)=='*') $type=DocComment; else $channel=HIDDEN;} ( options {greedy=false;} : . )* '*/' + ; + +LINE_COMMENT + : '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;} + ; + + + + Added: uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.tokens URL: http://svn.apache.org/viewvc/uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.tokens?rev=1504044&view=auto ============================================================================== --- uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.tokens (added) +++ uima/sandbox/ruta/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.tokens Wed Jul 17 08:23:15 2013 @@ -0,0 +1,157 @@ +STAR=143 +FloatTypeSuffix=119 +OctalLiteral=117 +LOG=37 +CONTAINS=8 +REMOVE=70 +GREATEREQUAL=156 +MARKFAST=41 +CONDITION=96 +MATCHEDTEXT=76 +COUNT=14 +LOGN=105 +DYNAMICANCHORING=57 +NOT=68 +Identifier=129 +ACTION=97 +NOTEQUAL=153 +CLEAR=78 +VBAR=145 +DOUBLELIST=100 +ENDSWITH=63 +RPAREN=131 +CREATE=31 +GREATER=148 +SIN=106 +EXP=104 +CURRENTCOUNT=16 +COS=107 +TAN=108 +TYPELIST=103 +FloatString=91 +LESS=147 +REGEXP=25 +GET=73 +PARTOF=22 +UNMARK=53 +LAST=18 +COMMENT=159 +REMOVEDUPLICATE=71 +UNMARKALL=54 +RBRACK=133 +NEAR=20 +LINE_COMMENT=160 +IntegerTypeSuffix=114 +MARKSCORE=39 +REMOVESTRING=77 +TRANSFER=55 +LCURLY=134 +TRIE=7 +FILTERTYPE=46 +STRINGLIST=102 +MARKONCE=40 +ScriptString=83 +EngineString=84 +WS=158 +WORDTABLE=11 +WORDLIST=10 +AutomataBlockString=87 +FloatingPointLiteral=120 +STARTANCHOR=112 +INTLIST=99 +OR=21 +TRIM=58 +JavaIDDigit=128 +FLOATLIST=101 +CALL=47 +Annotation=5 +FALSE=111 +LESSEQUAL=155 +RessourceLiteral=124 +VOTE=27 +Letter=127 +EscapeSequence=121 +SIZE=75 +REMOVEFILTERTYPE=67 +LBRACK=132 +CharacterLiteral=122 +DEL=36 +ATTRIBUTE=34 +TypeString=88 +SHIFT=56 +Exponent=118 +ASSIGN_EQUAL=149 +RETAINTYPE=45 +TypeSystemString=94 +AND=12 +ADDFILTERTYPE=66 +BlockString=86 +IntString=89 +HexDigit=113 +COLOR=35 +LPAREN=130 +POSITION=24 +IF=28 +LogLevel=80 +CONFIGURE=49 +SLASH=144 +THEN=79 +FILL=33 +COMMA=139 +IS=61 +AMPER=146 +REPLACE=44 +GETLIST=74 +WILDCARD=157 +EQUAL=152 +GATHER=32 +INLIST=17 +PLUS=141 +BooleanString=93 +GETFEATURE=52 +DOT=137 +ListIdentifier=6 +PARTOFNEQ=23 +BOOLEANLIST=98 +ADD=69 +MARKTABLE=42 +HexLiteral=115 +XOR=109 +PERCENT=150 +MARK=38 +PARSE=30 +PackageString=82 +OldColor=81 +MARKLAST=43 +MERGE=72 +CONTEXTCOUNT=13 +BEFORE=59 +EXEC=48 +MINUS=142 +AFTER=60 +DecimalLiteral=116 +SEMI=140 +TRUE=110 +FEATURE=29 +SymbolString=95 +COLON=138 +StringLiteral=123 +StringString=92 +SCORE=26 +QUESTION=151 +ADDRETAINTYPE=64 +UnicodeEscape=125 +RCURLY=135 +STARTSWITH=62 +ASSIGN=50 +REMOVERETAINTYPE=65 +TOTALCOUNT=15 +DECLARE=9 +UimafitString=85 +DocComment=4 +MOFN=19 +OctalEscape=126 +SETFEATURE=51 +DoubleString=90 +CIRCUMFLEX=136 +ALT_NOTEQUAL=154