Modified: uima/uv3/ruta-v3/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/query/ui/QueryActionHandler.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/query/ui/QueryActionHandler.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/query/ui/QueryActionHandler.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-addons/src/main/java/org/apache/uima/ruta/query/ui/QueryActionHandler.java Wed Jan 16 11:45:02 2019 @@ -21,7 +21,6 @@ package org.apache.uima.ruta.query.ui; import java.io.File; import java.io.FileFilter; -import java.io.FileInputStream; import java.io.IOException; import java.net.URL; import java.util.ArrayList; @@ -29,6 +28,7 @@ import java.util.Collection; import java.util.List; import java.util.regex.Pattern; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.apache.uima.UIMAFramework; import org.apache.uima.analysis_engine.AnalysisEngine; @@ -38,7 +38,6 @@ import org.apache.uima.cas.FSIterator; import org.apache.uima.cas.Feature; import org.apache.uima.cas.FeatureStructure; import org.apache.uima.cas.Type; -import org.apache.uima.cas.impl.XmiCasDeserializer; import org.apache.uima.cas.text.AnnotationFS; import org.apache.uima.cas.text.AnnotationIndex; import org.apache.uima.jcas.cas.FSArray; @@ -58,6 +57,7 @@ import org.apache.uima.ruta.extensions.I import org.apache.uima.ruta.ide.core.RutaExtensionManager; import org.apache.uima.ruta.ide.core.builder.RutaProjectUtils; import org.apache.uima.util.CasCreationUtils; +import org.apache.uima.util.CasIOUtils; import org.apache.uima.util.FileUtils; import org.apache.uima.util.XMLInputSource; import org.eclipse.core.commands.ExecutionEvent; @@ -114,14 +114,14 @@ public class QueryActionHandler implemen private final String fileNameFilter; QueryHandlerJob(ExecutionEvent event, String dir, String fileNameFilter, String typeSystem, - String rules, boolean recurive) { + String rules, boolean recursive) { super(String.format("Query in \"%s\" [filter: \"%s\"] ...", dir, fileNameFilter)); this.event = event; this.dataLocation = dir; this.fileNameFilter = fileNameFilter; this.typeSystemLocation = typeSystem; this.rules = rules; - this.recursive = recurive; + this.recursive = recursive; setUser(true); } @@ -280,8 +280,11 @@ public class QueryActionHandler implemen } cas.reset(); - if (each.getName().endsWith("xmi")) { - XmiCasDeserializer.deserialize(new FileInputStream(each), cas, true); + if (FilenameUtils.getExtension(each.getName()).equalsIgnoreCase("xmi") || + FilenameUtils.getExtension(each.getName()).equalsIgnoreCase("bcas") || + FilenameUtils.getExtension(each.getName()).equalsIgnoreCase("scas") || + FilenameUtils.getExtension(each.getName()).equalsIgnoreCase("xcas")) { + CasIOUtils.load(each.toURI().toURL(), cas); } else { cas.setDocumentText(getText(each)); }
Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/formatter/RutaFormattedPrinter.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/formatter/RutaFormattedPrinter.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/formatter/RutaFormattedPrinter.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/formatter/RutaFormattedPrinter.java Wed Jan 16 11:45:02 2019 @@ -83,7 +83,7 @@ public class RutaFormattedPrinter extend private static final String CONCAT = " + "; private static final String CONCAT_RULES = "% "; - + private static final String COMMA = ","; private static final int NL_DECLS_COUNT = 2; @@ -132,7 +132,8 @@ public class RutaFormattedPrinter extend private boolean retainLB = true; public RutaFormattedPrinter(FormatterDocument document, String lineDelimiter, - IFormatterIndentGenerator indentGenerator, List<CommonToken> comments, RutaFormatter tmf) { + IFormatterIndentGenerator indentGenerator, List<CommonToken> comments, + RutaFormatter tmf) { this.document = document; this.lineDelimiter = lineDelimiter; this.indentGenerator = indentGenerator; @@ -209,7 +210,8 @@ public class RutaFormattedPrinter extend if (expressions.size() > 1) { for (int i = 1; i < expressions.size(); i++) { Expression expression = expressions.get(i); - if (expression.getKind() == RutaTypeConstants.RUTA_TYPE_N && i < expressions.size() - 1) { + if (expression.getKind() == RutaTypeConstants.RUTA_TYPE_N + && i < expressions.size() - 1) { append(expression); append(EQUALS); append(expressions.get(++i)); @@ -353,7 +355,7 @@ public class RutaFormattedPrinter extend if (inLargeRule == 2) { inLargeRule = 4; } - if(cre.isAfterConcat()) { + if (cre.isAfterConcat()) { append(CONCAT_RULES); } append(PAR_OPEN); @@ -381,7 +383,7 @@ public class RutaFormattedPrinter extend } else if (inLargeRule == 1) { inLargeRule = 2; } - if(ruleEl.isAfterConcat()) { + if (ruleEl.isAfterConcat()) { append(CONCAT_RULES); } appendRuleElement(ruleEl); @@ -611,7 +613,7 @@ public class RutaFormattedPrinter extend * @param ruleEl * @param conditions * @param actions - * @throws Exception + * @throws Exception */ private void appendRuleElement(RutaRuleElement ruleEl) throws Exception { // if (ruleEl instanceof ComposedRuleElement) { @@ -634,7 +636,7 @@ public class RutaFormattedPrinter extend if (ruleEl.getHead() != null) { append(ruleEl.getHead()); } - if(ruleEl.isWildcard()) { + if (ruleEl.isWildcard()) { append("#"); } List<RutaCondition> conditions = ruleEl.getConditions(); @@ -679,9 +681,8 @@ public class RutaFormattedPrinter extend return; } - if (!inBlockDeclaration - && ((conditions == null && actions.isEmpty()) || actions == null - && (conditions != null) && conditions.isEmpty())) { + if (!inBlockDeclaration && ((conditions == null && actions.isEmpty()) + || actions == null && (conditions != null) && conditions.isEmpty())) { return; } append(CURLY_OPEN); @@ -701,14 +702,16 @@ public class RutaFormattedPrinter extend traverseAstNodes(actions); } append(CURLY_CLOSE); - if(ruleEl.getInlinedRules()!= null && !ruleEl.getInlinedRules().isEmpty()) { + if (ruleEl.getInlinedRuleBlocks() != null && !ruleEl.getInlinedRuleBlocks().isEmpty()) { String inlineMode = ruleEl.getInlineMode(); append(inlineMode); append(CURLY_OPEN); indentLevel++; - List<RutaRule> inlinedRules = ruleEl.getInlinedRules(); - for (RutaRule rutaRule : inlinedRules) { - visit(rutaRule); + List<List<RutaRule>> inlinedRuleBlocks = ruleEl.getInlinedRuleBlocks(); + for (List<RutaRule> inlinedRules : inlinedRuleBlocks) { + for (RutaRule rutaRule : inlinedRules) { + visit(rutaRule); + } } indentLevel--; appendIntoNewLine(CURLY_CLOSE); Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPageFolder.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPageFolder.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPageFolder.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPageFolder.java Wed Jan 16 11:45:02 2019 @@ -28,9 +28,9 @@ import java.util.HashMap; import java.util.List; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; +import org.apache.commons.io.IOUtils; +import org.apache.uima.ruta.utils.XmlUtils; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -90,16 +90,13 @@ public class RutaPageFolder { // Do the parsing and obtain the top-level node Element config = null; try { - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DocumentBuilder parser = XmlUtils.createDocumentBuilder(); parser.setErrorHandler(new DefaultHandler()); config = parser.parse(new InputSource(stream)).getDocumentElement(); } catch (SAXException e) { throw new IOException("Bad XML format"); - } catch (ParserConfigurationException e) { - stream.close(); - throw new IOException("Bad XML format"); } finally { - stream.close(); + IOUtils.closeQuietly(stream); } if (!config.getNodeName().equalsIgnoreCase("manPages")) { Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPagesLocationsBlock.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPagesLocationsBlock.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPagesLocationsBlock.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/documentation/RutaPagesLocationsBlock.java Wed Jan 16 11:45:02 2019 @@ -33,9 +33,8 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; @@ -45,6 +44,7 @@ import javax.xml.transform.dom.DOMSource import javax.xml.transform.stream.StreamResult; import org.apache.uima.ruta.ide.ui.RutaPreferenceConstants; +import org.apache.uima.ruta.utils.XmlUtils; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -141,14 +141,7 @@ public class RutaPagesLocationsBlock imp return null; // Create the Document and the top-level node - DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder; - try { - docBuilder = dfactory.newDocumentBuilder(); - } catch (ParserConfigurationException e1) { - e1.printStackTrace(); - return null; - } + DocumentBuilder docBuilder = XmlUtils.createDocumentBuilder(); Document doc = docBuilder.newDocument(); Element topElement = doc.createElement("manPages"); @@ -173,8 +166,9 @@ public class RutaPagesLocationsBlock imp try { TransformerFactory factory = TransformerFactory.newInstance(); - Transformer transformer; - transformer = factory.newTransformer(); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); + Transformer transformer = factory.newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/editor/RutaEditor.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/editor/RutaEditor.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/editor/RutaEditor.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/editor/RutaEditor.java Wed Jan 16 11:45:02 2019 @@ -46,6 +46,7 @@ import org.eclipse.dltk.core.IModelEleme import org.eclipse.dltk.core.ISourceRange; import org.eclipse.dltk.core.ISourceReference; import org.eclipse.dltk.core.ModelException; +import org.eclipse.dltk.internal.core.SourceModule; import org.eclipse.dltk.internal.ui.actions.FoldingActionGroup; import org.eclipse.dltk.internal.ui.editor.DLTKEditorMessages; import org.eclipse.dltk.internal.ui.editor.ScriptEditor; @@ -195,8 +196,8 @@ public class RutaEditor extends ScriptEd markAsStateDependentAction("Comment", true); //$NON-NLS-1$ // Uncomment - action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(), - "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$ + action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(), "Uncomment.", //$NON-NLS-1$ + this, ITextOperationTarget.STRIP_PREFIX); action.setActionDefinitionId(IScriptEditorActionDefinitionIds.UNCOMMENT); setAction("Uncomment", action); //$NON-NLS-1$ markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ @@ -209,8 +210,8 @@ public class RutaEditor extends ScriptEd markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$ configureToggleCommentAction(); - action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(), - "Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$ + action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(), "Format.", //$NON-NLS-1$ + this, ISourceViewer.FORMAT); action.setActionDefinitionId(IScriptEditorActionDefinitionIds.FORMAT); setAction("Format", action); //$NON-NLS-1$ markAsStateDependentAction("Format", true); //$NON-NLS-1$ @@ -297,8 +298,8 @@ public class RutaEditor extends ScriptEd @Override protected FoldingActionGroup createFoldingActionGroup() { - return new FoldingActionGroup(this, getViewer(), RutaIdeUIPlugin.getDefault() - .getPreferenceStore()); + return new FoldingActionGroup(this, getViewer(), + RutaIdeUIPlugin.getDefault().getPreferenceStore()); } @Override @@ -316,19 +317,26 @@ public class RutaEditor extends ScriptEd if (myAnnotations != null && !myAnnotations.isEmpty()) { removeAnnotations(myAnnotations.keySet()); } + ModuleDeclaration parsed = null; + int caret = 0; RutaSelectionParser parser = new RutaSelectionParser(); - ISourceModule unit = (ISourceModule) getInputModelElement(); - ModuleDeclaration parsed = parser.parse(unit); - ISourceViewer sourceViewer = getSourceViewer(); - StyledText styledText = sourceViewer.getTextWidget(); - int caret = 0; - if (sourceViewer instanceof ITextViewerExtension5) { - ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer; - caret = extension.widgetOffset2ModelOffset(styledText.getCaretOffset()); - } else { - int offset = sourceViewer.getVisibleRegion().getOffset(); - caret = offset + styledText.getCaretOffset(); + IModelElement unitObject = getInputModelElement(); + if (unitObject instanceof SourceModule) { + SourceModule unit = (SourceModule) unitObject; + parsed = parser.parse(unit); + ISourceViewer sourceViewer = getSourceViewer(); + StyledText styledText = sourceViewer.getTextWidget(); + if (sourceViewer instanceof ITextViewerExtension5) { + ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer; + caret = extension.widgetOffset2ModelOffset(styledText.getCaretOffset()); + } else { + int offset = sourceViewer.getVisibleRegion().getOffset(); + caret = offset + styledText.getCaretOffset(); + } + } + if (parsed == null) { + return; } RutaReferenceVisitor visitor1 = new RutaReferenceVisitor(caret); ASTNode node = null; @@ -479,8 +487,8 @@ public class RutaEditor extends ScriptEd } else { IRegion visibleRegion = sourceViewer.getVisibleRegion(); // http://dev.eclipse.org/bugs/show_bug.cgi?id=34195 - visible = (targetOffset >= visibleRegion.getOffset() && targetOffset <= visibleRegion - .getOffset() + visibleRegion.getLength()); + visible = (targetOffset >= visibleRegion.getOffset() + && targetOffset <= visibleRegion.getOffset() + visibleRegion.getLength()); } if (!visible) { Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/LanguageCheckerVisitor.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/LanguageCheckerVisitor.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/LanguageCheckerVisitor.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/LanguageCheckerVisitor.java Wed Jan 16 11:45:02 2019 @@ -665,6 +665,11 @@ public class LanguageCheckerVisitor exte || StringUtils.equals(split[split.length - 1], "coveredText")) { return false; } + Integer prefixType = getVariableType(split[0]); + if (prefixType == RutaTypeConstants.RUTA_TYPE_UA + || prefixType == RutaTypeConstants.RUTA_TYPE_UAL) { + return false; + } } pr.reportProblem(problemFactory.createTypeProblem(ref, sourceModule)); @@ -933,6 +938,12 @@ public class LanguageCheckerVisitor exte return; } + // match expression against local annotation variables cannot be checked + if (variableType2 == RutaTypeConstants.RUTA_TYPE_UA + || variableType2 == RutaTypeConstants.RUTA_TYPE_UAL) { + return; + } + match = expand(match); if (match != null) { int kind = -1; @@ -942,6 +953,8 @@ public class LanguageCheckerVisitor exte kind = RutaTypeConstants.RUTA_TYPE_S; } else if (fme.getValue() instanceof NumericLiteral) { kind = RutaTypeConstants.RUTA_TYPE_N; + } else if (fme.getValue() instanceof RutaVariableReference) { + kind = ((RutaVariableReference) fme.getValue()).getType(); } else if (fme.getValue() instanceof RutaFunction) { // check on function deactivates, requires correct parsing of AST with external factory kind = -1; Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/RuleElementLabelVisitor.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/RuleElementLabelVisitor.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/RuleElementLabelVisitor.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/validator/RuleElementLabelVisitor.java Wed Jan 16 11:45:02 2019 @@ -23,22 +23,29 @@ import java.util.Collection; import java.util.HashSet; import org.apache.commons.lang3.StringUtils; +import org.apache.uima.ruta.ide.parser.ast.RutaAction; import org.apache.uima.ruta.ide.parser.ast.RutaRuleElement; import org.eclipse.dltk.ast.ASTVisitor; import org.eclipse.dltk.ast.expressions.Expression; -public class RuleElementLabelVisitor extends ASTVisitor{ +public class RuleElementLabelVisitor extends ASTVisitor { private Collection<String> labels = new HashSet<>(); - + @Override public boolean visit(Expression s) throws Exception { - if(s instanceof RutaRuleElement) { + if (s instanceof RutaRuleElement) { RutaRuleElement element = (RutaRuleElement) s; - if(!StringUtils.isBlank(element.getLabel())) { + if (!StringUtils.isBlank(element.getLabel())) { labels.add(element.getLabel()); } return true; + } else if (s instanceof RutaAction) { + RutaAction action = (RutaAction) s; + if (!StringUtils.isBlank(action.getLabel())) { + labels.add(action.getLabel()); + } + return true; } return false; } Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaLexer.g Wed Jan 16 11:45:02 2019 @@ -388,6 +388,9 @@ ADDRESS_PREFIX STARTANCHOR : '@'; + + +OPTIONAL : '_' ; HexLiteral : '0' ('x'|'X') HexDigit+ IntegerTypeSuffix? ; Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaParser.g URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaParser.g?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaParser.g (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/antlr3/org/apache/uima/ruta/ide/core/parser/RutaParser.g Wed Jan 16 11:45:02 2019 @@ -816,21 +816,31 @@ String label = null; re1 = ruleElementType {re = re1;} | re2 = ruleElementLiteral {re = re2;} | re3 = ruleElementComposed {re = re3;} - | re4 = ruleElementWildCard {re = re4;} + | re4 = ruleElementSpecial {re = re4;} ) {re.setLabel(label);} - (t = THEN2 LCURLY (rule = simpleStatement {innerRules.add(rule);})+ - RCURLY {re.setInlinedRules(innerRules);re.setInlineMode(t == null ? null : t.getText());})? - (t = THEN LCURLY (rule = simpleStatement {innerRules.add(rule);})+ - RCURLY {re.setInlinedRules(innerRules);re.setInlineMode(t == null ? null : t.getText());})? + + ( + t = THEN2 LCURLY + {innerRules = new ArrayList<RutaRule>();} + (rule = simpleStatement {innerRules.add(rule);})+ + RCURLY {re.addInlinedRules(innerRules);} + )* + + ( + t = THEN LCURLY + {innerRules = new ArrayList<RutaRule>();} + (rule = simpleStatement {innerRules.add(rule);})+ + RCURLY {re.addInlinedRules(innerRules);} + )* ; -ruleElementWildCard returns [RutaRuleElement re = null] +ruleElementSpecial returns [RutaRuleElement re = null] @init{ List<RutaCondition> dummyConds = new ArrayList<RutaCondition>(); } : - w = WILDCARD + w = (WILDCARD | OPTIONAL) (LCURLY { @@ -849,6 +859,7 @@ List<RutaCondition> dummyConds = new Arr ; + ruleElementComposed returns [ComposedRuleElement re = null] @init{ @@ -1548,8 +1559,10 @@ result = ActionFactory.createEmptyAction action returns [RutaAction result = null] @init { result = ActionFactory.createEmptyAction(input.LT(1)); +String label = null; } : + (l = Identifier {label = l.getText();} COLON)? ( a = actionColor | a = actionDel @@ -1600,7 +1613,7 @@ result = ActionFactory.createEmptyAction | (typeExpression)=> te = typeExpression {a = ActionFactory.createAction(te);} // | a = variableAction - ) {result = a;} + ) {result = a; result.setLabel(label);} ; @@ -2658,6 +2671,8 @@ composedBooleanExpression returns [Expre (e2 = booleanCompare)=> e2 = booleanCompare {expr = e2;} | (bne = booleanNumberExpression)=> bne = booleanNumberExpression{expr = bne;} | (bse = booleanStringExpression)=> bse = booleanStringExpression{expr = bse;} + | (booleanAnnotationListExpression)=> bale = booleanAnnotationListExpression {expr = bale;} + | (booleanAnnotationExpression)=> bae = booleanAnnotationExpression {expr = bae;} | (bte = booleanTypeExpression)=> bte = booleanTypeExpression{expr = bte;} | e1 = booleanFunction {expr = e1;} | LPAREN ep = booleanExpression RPAREN {expr = ep;} @@ -2698,13 +2713,29 @@ literalBooleanExpression returns [Boole | value = FALSE) {expr = ExpressionFactory.createSimpleBooleanExpression(value);} ; + +booleanAnnotationExpression returns [Expression expr = null] + : + e1 = annotationExpression + op = (EQUAL | NOTEQUAL) + ( e2 = annotationExpression | e2 = nullExpression ) + {expr = ExpressionFactory.createBooleanAnnotationExpression(e1,op,e2);} + ; + +booleanAnnotationListExpression returns [Expression expr = null] + : + e1 = annotationListExpression + op = (EQUAL | NOTEQUAL) + e2 = annotationListExpression + {expr = ExpressionFactory.createBooleanAnnotationListExpression(e1,op,e2);} + ; //not checked booleanTypeExpression returns [Expression expr = null] : e1 = typeExpression op = (EQUAL | NOTEQUAL) - e2 = typeExpression + ( e2 = typeExpression | e2 = nullExpression ) {expr = ExpressionFactory.createBooleanTypeExpression(e1,op,e2);} ; @@ -2725,7 +2756,7 @@ booleanStringExpression returns [Expre //LPAREN e1 = stringExpression op = (EQUAL | NOTEQUAL) - e2 = stringExpression + ( e2 = stringExpression | e2 = nullExpression ) //RPAREN {expr = ExpressionFactory.createBooleanStringExpression(e1,op,e2);} ; Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/RutaKeywordsManager.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/RutaKeywordsManager.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/RutaKeywordsManager.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/RutaKeywordsManager.java Wed Jan 16 11:45:02 2019 @@ -40,11 +40,11 @@ public final class RutaKeywordsManager { private static boolean initialized = false; - private static void initialize() { + private synchronized static void initialize() { if (initialized) { return; } - initialized = true; + IConfigurationElement[] cfg = Platform.getExtensionRegistry().getConfigurationElementsFor( EXTENSION_POINT); for (int i = 0; i < IRutaKeywords.END_INDEX; i++) { @@ -115,6 +115,7 @@ public final class RutaKeywordsManager { all[IRutaKeywords.DECLARATION] = RutaKeywords.append(all[IRutaKeywords.DECLARATION], knownExtensions); } + initialized = true; } public static String[] getKeywords() { Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/DLTKRutaHelper.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/DLTKRutaHelper.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/DLTKRutaHelper.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/DLTKRutaHelper.java Wed Jan 16 11:45:02 2019 @@ -33,11 +33,10 @@ import java.util.Map; import java.util.Set; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import org.apache.uima.ruta.engine.RutaEngine; import org.apache.uima.ruta.ide.RutaIdeCorePlugin; +import org.apache.uima.ruta.utils.XmlUtils; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -370,13 +369,11 @@ public class DLTKRutaHelper { private static Document getDocument(String text) { try { - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + DocumentBuilder parser = XmlUtils.createDocumentBuilder(); parser.setErrorHandler(new DefaultHandler()); Document document = parser.parse(new ByteArrayInputStream(text.getBytes())); return document; } catch (IOException e) { - - } catch (ParserConfigurationException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); } Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/PackagesManager.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/PackagesManager.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/PackagesManager.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/core/packages/PackagesManager.java Wed Jan 16 11:45:02 2019 @@ -36,9 +36,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; @@ -48,6 +47,7 @@ import javax.xml.transform.stream.Stream import org.apache.uima.ruta.ide.RutaIdeCorePlugin; import org.apache.uima.ruta.ide.core.packages.DLTKRutaHelper.RutaPackage; +import org.apache.uima.ruta.utils.XmlUtils; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -179,17 +179,11 @@ public class PackagesManager { IPath packagesPath = RutaIdeCorePlugin.getDefault().getStateLocation().append(PACKAGES_FILE); File packagesFile = packagesPath.toFile(); if (packagesFile.exists()) { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; try { - builder = factory.newDocumentBuilder(); + DocumentBuilder builder = XmlUtils.createDocumentBuilder(); Document document = builder.parse(new BufferedInputStream( new FileInputStream(packagesFile), 2048)); populate(document.getDocumentElement()); - } catch (ParserConfigurationException e) { - if (DLTKCore.DEBUG) { - e.printStackTrace(); - } } catch (FileNotFoundException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); @@ -209,10 +203,9 @@ public class PackagesManager { private void save() { IPath packagesPath = RutaIdeCorePlugin.getDefault().getStateLocation().append(PACKAGES_FILE); File packagesFile = packagesPath.toFile(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; try { - builder = factory.newDocumentBuilder(); + builder = XmlUtils.createDocumentBuilder(); Document document = builder.newDocument(); save(document); @@ -220,6 +213,8 @@ public class PackagesManager { BufferedOutputStream bos = new BufferedOutputStream(fos, 2048); TransformerFactory serFactory = TransformerFactory.newInstance(); + serFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + serFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = serFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ @@ -230,10 +225,6 @@ public class PackagesManager { bos.close(); fos.close(); - } catch (ParserConfigurationException e) { - if (DLTKCore.DEBUG) { - e.printStackTrace(); - } } catch (FileNotFoundException e) { if (DLTKCore.DEBUG) { e.printStackTrace(); Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ComposedRuleElement.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ComposedRuleElement.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ComposedRuleElement.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ComposedRuleElement.java Wed Jan 16 11:45:02 2019 @@ -68,9 +68,11 @@ public class ComposedRuleElement extends action.traverse(visitor); } } - if(inlinedRules != null) { - for (RutaRule rule : inlinedRules) { - rule.traverse(visitor); + if (getInlinedRuleBlocks() != null) { + for (List<RutaRule> inlinedRules : getInlinedRuleBlocks()) { + for (RutaRule rule : inlinedRules) { + rule.traverse(visitor); + } } } visitor.endvisit(this); Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ExpressionFactory.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ExpressionFactory.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ExpressionFactory.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/ExpressionFactory.java Wed Jan 16 11:45:02 2019 @@ -51,7 +51,8 @@ public class ExpressionFactory extends A return newVariableReference(ref, RutaTypeConstants.RUTA_TYPE_G); } - public static RutaQuantifierLiteralExpression createQuantifierLiteralExpression(Token q, Token q2) { + public static RutaQuantifierLiteralExpression createQuantifierLiteralExpression(Token q, + Token q2) { int bounds[] = getBounds(q); if (q2 != null) { bounds[1] = Math.max(bounds[1], getBounds(q2)[1]); @@ -144,6 +145,14 @@ public class ExpressionFactory extends A return newVariableReference(atRef, RutaTypeConstants.RUTA_TYPE_AT); } + public static VariableReference createAnnotationVariableReference(Token atRef) { + return newVariableReference(atRef, RutaTypeConstants.RUTA_TYPE_UA); + } + + public static VariableReference createAnnotationListVariableReference(Token atRef) { + return newVariableReference(atRef, RutaTypeConstants.RUTA_TYPE_UAL); + } + public static Expression createAnnotationTypeConstantReference(Token atBasic) { int bounds[] = getBounds(atBasic); return new RutaVariableReference(bounds[0], bounds[1], atBasic.getText(), @@ -271,7 +280,8 @@ public class ExpressionFactory extends A // TODO public static Expression createBooleanFunction(Token op, Expression e1, Expression e2) { - return new RutaExpression(e1.sourceStart(), e2.sourceEnd(), null, RutaTypeConstants.RUTA_TYPE_B); + return new RutaExpression(e1.sourceStart(), e2.sourceEnd(), null, + RutaTypeConstants.RUTA_TYPE_B); } public static Expression createListVariableReference(Token id) { @@ -281,17 +291,16 @@ public class ExpressionFactory extends A public static Expression createTableVariableReference(Token id) { return newVariableReference(id, RutaTypeConstants.RUTA_TYPE_WT); } - + public static Expression createListVariableReference(Expression ref) { int bounds[] = getSurroundingBounds(ref); return new RutaVariableReference(bounds[0], bounds[1], "", RutaTypeConstants.RUTA_TYPE_WL); } - + public static Expression createTableVariableReference(Expression ref) { int bounds[] = getSurroundingBounds(ref); return new RutaVariableReference(bounds[0], bounds[1], "", RutaTypeConstants.RUTA_TYPE_WT); } - public static Expression createRessourceReference(Token path) { int bounds[] = getBounds(path); @@ -331,6 +340,48 @@ public class ExpressionFactory extends A return null; } + public static Expression createBooleanAnnotationExpression(Expression e1, Token op, + Expression e2) { + int lexerOpID = op.getType(); // Integer.valueOf(op.getText()); + int operatorID = 0; + // convert lexer-opId to dltk-opId: + switch (lexerOpID) { + case RutaLexer.EQUAL: + operatorID = E_EQUAL; + break; + case RutaLexer.NOTEQUAL: + operatorID = E_NOT_EQUAL; + break; + default: + break; + } + if (e1 != null && e2 != null) { + return new RutaBooleanCompareExpression(e1.sourceStart(), e2.sourceEnd(), operatorID, e1, e2); + } + return null; + } + + public static Expression createBooleanAnnotationListExpression(Expression e1, Token op, + Expression e2) { + int lexerOpID = op.getType(); // Integer.valueOf(op.getText()); + int operatorID = 0; + // convert lexer-opId to dltk-opId: + switch (lexerOpID) { + case RutaLexer.EQUAL: + operatorID = E_EQUAL; + break; + case RutaLexer.NOTEQUAL: + operatorID = E_NOT_EQUAL; + break; + default: + break; + } + if (e1 != null && e2 != null) { + return new RutaBooleanCompareExpression(e1.sourceStart(), e2.sourceEnd(), operatorID, e1, e2); + } + return null; + } + public static Expression createBooleanStringExpression(Expression e1, Token op, Expression e2) { int lexerOpID = op.getType(); // Integer.valueOf(op.getText()); int operatorID = 0; @@ -350,7 +401,7 @@ public class ExpressionFactory extends A } return null; } - + public static Expression createListExpression(List<Expression> exprList, int type) { List<ASTNode> l = new ArrayList<>(); int start = 0; @@ -443,16 +494,13 @@ public class ExpressionFactory extends A Expression arg, List<RutaCondition> cs) { int bounds[] = getBounds(match); int end = bounds[1]; - if(cs != null && !cs.isEmpty()) { - end = cs.get(cs.size()-1).sourceEnd(); - } else if(arg != null) { + if (cs != null && !cs.isEmpty()) { + end = cs.get(cs.size() - 1).sourceEnd(); + } else if (arg != null) { end = arg.sourceEnd(); } - FeatureMatchExpression reference = new FeatureMatchExpression(bounds[0], end, match, comp, arg); - return new ConditionedAnnotationTypeExpression(bounds[0], end , reference, arg, cs); + FeatureMatchExpression reference = new FeatureMatchExpression(bounds[0], end, match, comp, arg); + return new ConditionedAnnotationTypeExpression(bounds[0], end, reference, arg, cs); } - - - } Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaAction.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaAction.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaAction.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaAction.java Wed Jan 16 11:45:02 2019 @@ -45,14 +45,16 @@ public class RutaAction extends Expressi private String name; + private String label; + /** * @param start * @param end * @param exprs * @param kind */ - public RutaAction(int start, int end, List<ASTNode> exprs, int kind, String name, - int nameStart, int nameEnd) { + public RutaAction(int start, int end, List<ASTNode> exprs, int kind, String name, int nameStart, + int nameEnd) { super(start, end); if (exprs != null) { this.exprs = exprs; @@ -103,7 +105,16 @@ public class RutaAction extends Expressi return exprs; } + @Override public String toString() { return this.getClass().getSimpleName() + " : " + super.toString(); } + + public void setLabel(String label) { + this.label = label; + } + + public String getLabel() { + return label; + } } Modified: uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaRuleElement.java URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaRuleElement.java?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaRuleElement.java (original) +++ uima/uv3/ruta-v3/trunk/ruta-ep-ide/src/main/java/org/apache/uima/ruta/ide/parser/ast/RutaRuleElement.java Wed Jan 16 11:45:02 2019 @@ -35,8 +35,8 @@ public class RutaRuleElement extends Exp protected Expression head; protected List<Expression> quantifierExpressions; - - protected List<RutaRule> inlinedRules; + + private List<List<RutaRule>> inlinedRuleBlocks = new ArrayList<>(); private String inlineMode; @@ -45,7 +45,7 @@ public class RutaRuleElement extends Exp private boolean wildcard; private String label; - + // TODO to be removed public RutaRuleElement(int start, int end) { super(start, end); @@ -99,9 +99,11 @@ public class RutaRuleElement extends Exp action.traverse(visitor); } } - if(inlinedRules != null) { - for (RutaRule rule : inlinedRules) { - rule.traverse(visitor); + if (inlinedRuleBlocks != null) { + for (List<RutaRule> inlinedRules : inlinedRuleBlocks) { + for (RutaRule rule : inlinedRules) { + rule.traverse(visitor); + } } } visitor.endvisit(this); @@ -124,22 +126,19 @@ public class RutaRuleElement extends Exp return quantifierExpressions; } + @Override public String toString() { return this.getClass().getSimpleName() + " : " + super.toString(); } - public List<RutaRule> getInlinedRules() { - return inlinedRules; - } - - public void setInlinedRules(List<RutaRule> inlinedRules) { - if(inlinedRules != null && !inlinedRules.isEmpty()) { - RutaRule last = inlinedRules.get(inlinedRules.size()-1); - if(last != null) { + public void addInlinedRules(List<RutaRule> inlinedRules) { + if (inlinedRules != null && !inlinedRules.isEmpty()) { + RutaRule last = inlinedRules.get(inlinedRules.size() - 1); + if (last != null) { setEnd(last.sourceEnd()); } } - this.inlinedRules = inlinedRules; + inlinedRuleBlocks.add(inlinedRules); } public void setInlineMode(String mode) { @@ -171,11 +170,19 @@ public class RutaRuleElement extends Exp } public void setLabel(String label) { - this.label = label; + this.label = label; } - + public String getLabel() { return this.label; } - + + public List<List<RutaRule>> getInlinedRuleBlocks() { + return inlinedRuleBlocks; + } + + public void setInlinedRuleBlocks(List<List<RutaRule>> inlinedRuleBlocks) { + this.inlinedRuleBlocks = inlinedRuleBlocks; + } + } Modified: uima/uv3/ruta-v3/trunk/ruta-parent/pom.xml URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-parent/pom.xml?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-parent/pom.xml (original) +++ uima/uv3/ruta-v3/trunk/ruta-parent/pom.xml Wed Jan 16 11:45:02 2019 @@ -24,7 +24,7 @@ <parent> <groupId>org.apache.uima</groupId> <artifactId>parent-pom</artifactId> - <version>10</version> + <version>12</version> <relativePath /> </parent> @@ -193,6 +193,11 @@ Creative Commons Attribution 3.0 License </plugins> </pluginManagement> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>1.6</version> + </plugin> <plugin> <artifactId>maven-enforcer-plugin</artifactId> <executions> @@ -325,6 +330,8 @@ Creative Commons Attribution 3.0 License <exclude>org.apache.uima.ruta.type</exclude> <exclude>org.apache.uima.ruta.parser.RutaParser</exclude> </excludes> + <!-- filter out classes with impl in their package or class name --> + <postAnalysisScript>${project.basedir}/../ruta-parent/src/main/groovy/api-report.groovy</postAnalysisScript> </parameter> </configuration> <executions> Added: uima/uv3/ruta-v3/trunk/ruta-parent/src/main/groovy/api-report.groovy URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-parent/src/main/groovy/api-report.groovy?rev=1851430&view=auto ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-parent/src/main/groovy/api-report.groovy (added) +++ uima/uv3/ruta-v3/trunk/ruta-parent/src/main/groovy/api-report.groovy Wed Jan 16 11:45:02 2019 @@ -0,0 +1,27 @@ +/* + * 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. + */ + def it = jApiClasses.iterator() + while (it.hasNext()) { + def jApiClass = it.next() + def fqn = jApiClass.getFullyQualifiedName() + if (fqn.contains("impl")) { + it.remove() + } + } + return jApiClasses \ No newline at end of file Modified: uima/uv3/ruta-v3/trunk/ruta-typesystem/src/main/resources/org/apache/uima/ruta/engine/RutaInternalTypeSystem.xml URL: http://svn.apache.org/viewvc/uima/uv3/ruta-v3/trunk/ruta-typesystem/src/main/resources/org/apache/uima/ruta/engine/RutaInternalTypeSystem.xml?rev=1851430&r1=1851429&r2=1851430&view=diff ============================================================================== --- uima/uv3/ruta-v3/trunk/ruta-typesystem/src/main/resources/org/apache/uima/ruta/engine/RutaInternalTypeSystem.xml (original) +++ uima/uv3/ruta-v3/trunk/ruta-typesystem/src/main/resources/org/apache/uima/ruta/engine/RutaInternalTypeSystem.xml Wed Jan 16 11:45:02 2019 @@ -113,6 +113,11 @@ <description/> <rangeTypeName>uima.cas.String</rangeTypeName> </featureDescription> + <featureDescription> + <name>timestamp</name> + <description/> + <rangeTypeName>uima.cas.Long</rangeTypeName> + </featureDescription> </features> </typeDescription> <typeDescription>