Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • deniz.cingoez/robocup-speechrec
  • t.dilger/robocup-speechrec
  • msterz/robocup-speechrec
  • patric.steckstor/robocup-speechrec
  • jennifer.lee/robocup-speechrec
  • jharin/robocup-speechrec
  • f.thiemer/robocup-speechrec
  • augustin.harter/robocup-speechrec
  • jleichert/robocup-speechrec
9 results
Show changes
Showing
with 0 additions and 3478 deletions
This diff is collapsed.
%%
%% This is file `nomencl.ist',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nomencl.dtx (with options: `idxstyle')
%%
%% Copyright 1996 Boris Veytsman
%% Copyright 1999-2001 Bernd Schandl
%% www http://sarovar.org/projects/nomencl
%%
%% This file can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License distributed from CTAN
%% archives in the directory macros/latex/base/lppl.txt; either
%% version 1.2 of the license, or (at your option) any later version.
%%
%%
%% Nomenclature style file for MAKEINDEX.
%% For nomencl v2.5 (and later)
%%
%% Formats glossary entries to show, e.g. nomenclature of equations.
%%
%% Written by Boris Veytsman boris@plmsc.psu.edu
%% Changed by Bernd Schandl schandl@gmx.net (starting 1999/02/20)
%% Changed by Lee Netherton ltn100@users.sourceforge.net
%% (starting 2005/03/31)
%%
%% Changes:
%% 2005/04/27. Updates to the documentation, including support for hyperref (LN)
%% 2005/04/20. Improvements to Italian option, and minor documentation
%% changes (LN)
%% 2005/03/31. Made more compatible with other glossary packages. (LN)
%% Added option to include nomenclature in TOC. (LN)
%% 1996/11/25. Change quote character to % (BV)
%% 1999/02/20. Removed setting of actual to its default value
%% Removed setting of quote to '%' to get its default '"' instead
%% Changed group_skip to do nothing; user should use \nomgroup
%% Changed spacing in gls file
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
%% ---- for input file ----
keyword "\\nomenclatureentry"
%% Germans might want to change this and delete the two %%
%% quote '"'
%% ---- for output file ----
preamble "\\begin{thenomenclature} \n"%
postamble "\n\n\\end{thenomenclature}\n" group_skip "\n"
delim_0 ""
delim_1 ""
delim_2 ""
%% The next lines will produce some warnings when
%% running Makeindex as they try to cover two different
%% versions of the program:
lethead_prefix "\n \\nomgroup{"
lethead_suffix "}\n"
lethead_flag 1
heading_prefix "\n \\nomgroup{"
heading_suffix "}\n"
headings_flag 1
File deleted
source.isreditor.jar = src/
output.isreditor.jar = bin/
bin.includes = plugin.xml,\
isreditor.jar,\
icons/,\
lib/
src.includes = lib/xerces.jar,\
src/IsrGrammarXmlDefinition.dtd
jars.compile.order = isreditor.jar
<contexts>
<context id="viewer" title="Isr-grammar-viewer">
<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
<enablement>
<with variable="platform">
<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
</with>
</enablement>
</topic>
</context>
</contexts>
isr-eclipse-plugin/icons/sample.gif

983 B

File deleted
File deleted
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension id="hterhors.editor.isr.editor" point="org.eclipse.ui.editors">
<editor id="hterhors.editor.ISREditor" name="ISR-Editor"
class="hterhors.editor.ISREditor" contributorClass="hterhors.editor.ISREditorContributor"
extensions="grm" icon="icons/sample.gif">
</editor>
</extension>
<extension id="problemmarker" name="Error Marker"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.marker" />
<attribute name="severity" />
<attribute name="message" />
<attribute name="location" />
<persistent value="true" />
</extension>
<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="hterhors.editor.xmlconverter.converttoxmlaction.contribution"
nameFilter="*.grm" objectClass="org.eclipse.core.resources.IFile">
<action id="hterhors.editor.xmlconverter.converttoxmlaction"
class="hterhors.editor.xmlconverter.ConvertToXMLAction"
definitionId="hterhors.editor.xmlconverter.converttoxmlaction.definition"
enablesFor="1"
icon="icons/sample.gif" label="Convert to XML" menubarPath="additions">
</action>
</objectContribution>
</extension>
<extension point="org.eclipse.ui.perspectives">
<perspective id="hterhors.editor.perspective.IsrPerspective"
name="Isr Grammar" class="hterhors.editor.perspective.IsrPerspective"
icon="icons/sample.gif">
</perspective>
</extension>
<extension point="org.eclipse.ui.views">
<category id="view" name="Isr-grammar-viewer">
</category>
<view id="hterhors.editor.zest.IsrGraphView" name="Isr-grammar-viewer"
category="view" class="hterhors.editor.zest.IsrGraphView" icon="icons/sample.gif">
</view>
</extension>
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
<view id="hterhors.editor.zest.IsrGraphView" ratio="0.9"
relationship="right" relative="org.eclipse.ui.editorss">
</view>
</perspectiveExtension>
</extension>
<!--extension point="org.eclipse.help.contexts">
<contexts file="contexts.xml">
</contexts>
</extension-->
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="isr.graph.visualization" name="Update graph"
categoryId="visualization.category">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.UpdateGraphHandler"
commandId="isr.graph.visualization">
</handler>
</extension>
<extension point="org.eclipse.ui.bindings">
<key commandId="isr.graph.visualization" contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+Shift+V">
</key>
</extension>
<!-- GRID -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.GridLayoutGraphHandler"
commandId="grid.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="grid.graph" name="Grid-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- HORIZONTAL -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.HorizontalTreeLayoutGraphHandler"
commandId="horizontal.tree.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="horizontal.tree.graph" name="Horizontal-Tree-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- RADIAL -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.RadialLayoutGraphHandler"
commandId="radial.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="radial.graph" name="Radial-Tree-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- SPRING -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.SpringLayoutGraphHandler"
commandId="spring.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="spring.graph" name="Spring-Tree-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- TREE -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.TreeLayoutGraphHandler"
commandId="tree.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="tree.graph" name="Tree-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- VERTICAL -->
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.zest.layouthandler.VerticalLayoutGraphHandler"
commandId="vertical.graph">
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Isr visualization">
</category>
<command id="vertical.graph" name="Vertical-Tree-Layout"
categoryId="visualization.category">
</command>
</extension>
<!-- Parser -->
<extension point="org.eclipse.ui.commands">
<category id="visualization.category" name="Parse sentences">
</category>
<command id="parse.sentences" name="Parse sentences"
categoryId="visualization.category">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.sentenceparser.ParseSentenceHandler"
commandId="parse.sentences">
</handler>
</extension>
<extension point="org.eclipse.ui.bindings">
<key commandId="parse.sentences" contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+Shift+P">
</key>
</extension>
<!-- isr.info GENERAL -->
<extension point="org.eclipse.ui.commands">
<category id="isr.info.category" name="General">
</category>
<command id="isr.general.info" name="General"
categoryId="isr.info.category">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.info.InfoGeneralHandler"
commandId="isr.general.info">
</handler>
</extension>
<!-- isr.info EXAMPLE -->
<extension point="org.eclipse.ui.commands">
<category id="isr.info.category" name="Example">
</category>
<command id="isr.example.info" name="Example"
categoryId="isr.info.category">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.info.InfoExampleHandler"
commandId="isr.example.info">
</handler>
</extension>
<!-- isr.info SYNTAX -->
<extension point="org.eclipse.ui.commands">
<category id="isr.info.category" name="Syntax">
</category>
<command id="isr.syntax.info" name="Syntax"
categoryId="isr.info.category">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler class="hterhors.editor.info.InfoSyntaxHandler"
commandId="isr.syntax.info">
</handler>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu id="isr.menu" label="Isr" mnemonic="I">
<menu id="isr.menu.infos" label="Info" mnemonic="I">
<command id="isr.general.info.command" commandId="isr.general.info"
mnemonic="G">
</command>
<command id="isr.example.info.command" commandId="isr.example.info"
mnemonic="E">
</command>
<command id="isr.syntax.info.command" commandId="isr.syntax.info"
mnemonic="S">
</command>
</menu>
<command id="parse.sentences.command" commandId="parse.sentences"
mnemonic="P">
</command>
<command id="update.graph.command" commandId="isr.graph.visualization"
mnemonic="U">
</command>
<menu id="isr.menu.layouts" label="Graph layouts" mnemonic="L">
<command id="horizontal.tree.graph.command" commandId="horizontal.tree.graph"
mnemonic="H">
</command>
<command id="radial.graph.command" commandId="radial.graph"
mnemonic="R">
</command>
<command id="spring.graph.command" commandId="spring.graph"
mnemonic="S">
</command>
<command id="tree.graph.command" commandId="tree.graph"
mnemonic="T">
</command>
<command id="vertical.graph.command" commandId="vertical.graph"
mnemonic="V">
</command>
<command id="grid.graph.command" commandId="grid.graph"
mnemonic="G">
</command>
</menu>
<visibleWhen checkEnabled="false">
<with variable="selection">
<iterate ifEmpty="false" operator="or">
<!--or>
<adapt type="org.eclipse.core.resources.IResource">
<or>
<test property="org.eclipse.core.resources.extension"
value="grm">
</test>
</or>
</adapt-->
<with variable="activeEditorInput">
<adapt type="org.eclipse.core.resources.IResource">
<or>
<test property="org.eclipse.core.resources.extension"
value="grm">
</test>
</or>
</adapt>
</with>
<!--/or-->
</iterate>
</with>
</visibleWhen>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar id="isr.toolbars.update.graph">
<command id="isr.toolbar.update.graph.command" commandId="isr.graph.visualization"
icon="icons/sample.gif" tooltip="Update graph-visualization">
<visibleWhen checkEnabled="false">
<with variable="selection">
<iterate ifEmpty="false" operator="or">
<with variable="activeEditorInput">
<adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.extension"
value="grm">
</test>
</adapt>
</with>
</iterate>
</with>
</visibleWhen>
</command>
</toolbar>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
<hyperlinkDetector id="hterhors.editor.hyperlink.isrhyperlinkdetector"
name="IsrHyperLink" class="hterhors.editor.hyperlink.IsrHyperLinkDetector"
targetId="org.eclipse.ui.DefaultTextEditor">
</hyperlinkDetector>
</extension>
</plugin>
\ No newline at end of file
<!ELEMENT ISR_GRAMMAR (Start,DeclarationNonTerminal*)>
<!ELEMENT Start (Or?)*>
<!ATTLIST Start name CDATA #REQUIRED>
<!ELEMENT Terminal EMPTY>
<!ATTLIST Terminal name CDATA #REQUIRED>
<!ELEMENT NonTerminal EMPTY>
<!ATTLIST NonTerminal name CDATA #REQUIRED>
<!ELEMENT Or (NonTerminal|Terminal)*>
<!ELEMENT DeclarationNonTerminal (Or?)*>
<!ATTLIST DeclarationNonTerminal name CDATA #REQUIRED>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
SRGS XML Grammar Form DTD (20020524)
Copyright 1998-2002 W3C (MIT, INRIA, Keio), All Rights Reserved.
Permission to use, copy, modify and distribute the SRGS DTD and
its accompanying documentation for any purpose and without fee is
hereby granted in perpetuity, provided that the above copyright
notice and this paragraph appear in all copies.
The copyright holders make no representation about the suitability
of the DTD for any purpose. It is provided "as is" without expressed
or implied warranty.
-->
<!ENTITY % uri "CDATA">
<!ENTITY % rule-expansion "#PCDATA | token | ruleref
| item | one-of | tag ">
<!ENTITY % grammar-header "( meta | metadata | lexicon )*">
<!ENTITY % grammar-body "( rule )*">
<!ELEMENT ruleref EMPTY>
<!ATTLIST ruleref
uri %uri; #IMPLIED
type CDATA #IMPLIED
special (NULL | VOID | GARBAGE) #IMPLIED
xml:lang NMTOKEN #IMPLIED
>
<!ELEMENT token (#PCDATA)>
<!ATTLIST token
xml:lang NMTOKEN #IMPLIED
>
<!ELEMENT tag (#PCDATA)>
<!ELEMENT one-of (item)+>
<!ATTLIST one-of
xml:lang NMTOKEN #IMPLIED
>
<!ELEMENT item (%rule-expansion;)*>
<!ATTLIST item
repeat NMTOKEN #IMPLIED
repeat-prob NMTOKEN #IMPLIED
weight NMTOKEN #IMPLIED
xml:lang NMTOKEN #IMPLIED
>
<!ELEMENT rule (%rule-expansion; | example)*>
<!ATTLIST rule
id ID #REQUIRED
scope (private | public) "private"
>
<!ELEMENT example (#PCDATA)>
<!ELEMENT lexicon EMPTY>
<!ATTLIST lexicon
uri %uri;#REQUIRED
type CDATA #IMPLIED
>
<!ELEMENT meta EMPTY>
<!ATTLIST meta
name NMTOKEN #IMPLIED
content CDATA #REQUIRED
http-equiv NMTOKEN #IMPLIED
>
<!ELEMENT metadata EMPTY>
<!ELEMENT grammar (%grammar-header;, %grammar-body;)>
<!ATTLIST grammar
tag-format %uri; #IMPLIED
xml:base %uri; #IMPLIED
version NMTOKEN #REQUIRED
xml:lang NMTOKEN #IMPLIED
xmlns CDATA #REQUIRED
xmlns:xsi CDATA #IMPLIED
xsi:schemaLocation CDATA #IMPLIED
root IDREF #IMPLIED
mode (voice | dtmf) "voice"
>
\ No newline at end of file
package hterhors;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class Activator extends AbstractUIPlugin {
// The shared instance.
/**
* @uml.property name="plugin"
* @uml.associationEnd
*/
private static Activator plugin;
// Resource bundle.
/**
* @uml.property name="resourceBundle"
*/
private ResourceBundle resourceBundle;
/**
* The constructor.
*/
public Activator() {
super();
plugin = this;
try {
resourceBundle = ResourceBundle
.getBundle("hterhors.EditorPluginResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
}
/**
* Returns the shared instance.
*/
public static Activator getDefault() {
return plugin;
}
/**
* Returns the string from the plugin's resource bundle, or 'key' if not
* found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle = Activator.getDefault()
.getResourceBundle();
try {
return (bundle != null) ? bundle.getString(key) : key;
} catch (MissingResourceException e) {
return key;
}
}
/**
* Returns the plugin's resource bundle,
* @uml.property name="resourceBundle"
*/
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
}
ContentAssistProposal.label=Content Assists@Ctrl+SPACE
ContentAssistProposal.tooltip=Content Assist
ContentAssistProposal.image=
ContentAssistProposal.description=Content Assist
ContentAssistTip.label=Content Tip@Ctrl+SHIFT+SPACE
ContentAssistTip.tooltip=Content Tip
ContentAssistTip.image=
ContentAssistTip.description=Content Tip
ContentFormatProposal.label=Content Format@Ctrl+SHIFT+F
ContentFormatProposal.tooltip=Content Format
ContentFormatProposal.image=
ContentFormatProposal.description=Content Format
ContentFormatTip.label=Content Tip@Ctrl+SHIFT+SPACE
ContentFormatTip.tooltip=Content Tip
ContentFormatTip.image=
ContentFormatTip.description=Content Tip
package hterhors.editor;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
/**
* This class manages the
* @author Hendrik
*
*/
public class ColorManager {
protected Map fColorTable = new HashMap(10);
public void dispose() {
Iterator e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
}
public Color getColor(RGB rgb) {
Color color = (Color) fColorTable.get(rgb);
if (color == null) {
color = new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);
}
return color;
}
}
package hterhors.editor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextDoubleClickStrategy;
import org.eclipse.jface.text.ITextViewer;
/**
* Implements the editors double click strategy.
*
* @author Hendrik
*
*/
public class DoubleClickStrategy implements ITextDoubleClickStrategy {
protected ITextViewer fText;
@Override
public void doubleClicked(ITextViewer part) {
int pos = part.getSelectedRange().x;
if (pos < 0)
return;
fText = part;
selectWord(pos);
}
/**
* This method calculates the word which should be selected.
*
* @param caretPos
* the cursors current position
*/
protected void selectWord(int caretPos) {
IDocument doc = fText.getDocument();
int startPos, endPos;
try {
int pos = caretPos;
char c;
while (pos >= 0) {
c = doc.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
--pos;
}
startPos = pos;
pos = caretPos;
int length = doc.getLength();
while (pos < length) {
c = doc.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
++pos;
}
endPos = pos;
selectRange(startPos, endPos);
return;
} catch (BadLocationException x) {
}
return;
}
/**
* Triggers the selection.
*
* @param startPos
* startposition
* @param stopPos
* stopposition
*/
private void selectRange(int startPos, int stopPos) {
int offset = startPos + 1;
int length = stopPos - offset;
fText.setSelectedRange(offset, length);
}
}
\ No newline at end of file
package hterhors.editor;
import org.eclipse.swt.graphics.RGB;
public interface IISRColorConstants {
RGB DEC_NON_TERMINAL = new RGB(128, 0, 128);
RGB NON_TERMINAL = new RGB(0, 0, 192);
RGB START = new RGB(225, 0, 255);
RGB DEFAULT = new RGB(0, 0, 0);
RGB OR = new RGB(8, 255, 8);
RGB NUMBER = new RGB(192, 192, 0);
RGB IGNORE = new RGB(200, 0, 0);
RGB JOKER = new RGB(192, 128, 128);
RGB DEC_NON_TERMINAL_GRAPH = new RGB(255, 64, 255);
RGB NON_TERMINAL_GRAPH = new RGB(128, 128, 255);
RGB START_GRAPH = new RGB(225, 128, 255);
RGB OR_GRAPH = new RGB(0, 255, 0);
RGB IGNORE_GRAPH = new RGB(255, 128, 128);
RGB JOKER_GRAPH = new RGB(255, 192, 192);
}
\ No newline at end of file
package hterhors.editor;
import hterhors.editor.markers.IsrRuleValidator;
import java.util.ArrayList;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
/**
* @author Hendrik
*/
class ISRContentAssistantDefaultProcessor implements IContentAssistProcessor {
private final IContextInformation[] NO_CONTEXTS = {};
private final char[] PROPOSAL_ACTIVATION_CHARS = { 's', 'f', 'p', 'n', 'm', };
private ICompletionProposal[] NO_COMPLETIONS = {};
private int override = 0;
private String preSpace = "";
protected static final String lineSeparator = System
.getProperty("line.separator");
/**
* Use this method to set the size for overriding by using content-assistant.
* @param override The size to be override.
* @uml.property name="override"
*/
public void setOverride(int override) {
this.override = override;
}
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
try {
IDocument document = viewer.getDocument();
ArrayList<CompletionProposal> result = new ArrayList<CompletionProposal>();
if (!IsrRuleValidator.startSymbolExists(document.get())) {
result.add(new CompletionProposal(
preSpace + "$$S: ;" + lineSeparator,
offset,
override,
5 + preSpace.length(),
null,
"New start-symbol",
null,
"The '$$S' symbol is the start symbol and must be included\n"
+ "in the grammar. Additionally, the '$$SS' symbol is predefined and\n"
+ "must not be used in the grammatic description. "));
}
for (String nonterminal : IsrRuleValidator
.getMissingNontermDec(document.get())) {
result.add(new CompletionProposal(preSpace + "$" + nonterminal
+ ": ;" + lineSeparator, offset, override, 3
+ nonterminal.length() + preSpace.length(), null,
nonterminal + " - Missing!", null,
"Add the missing nonterminal-declaration ($"
+ nonterminal + ":) to the grammar."));
}
result.add(new CompletionProposal(
preSpace + "$: ;" + lineSeparator,
offset,
override,
1 + preSpace.length(),
null,
"New declaration",
null,
"\"NONTERMINAL\" symbols are defined equally as TERMINAL symbols but\n"
+ "must have a '$' or '$$' prefix.\n"
+ "Symbols with '$$' prefix are technical symbols which are describe\n"
+ "at \"New technical-nonterminal-declaration\"\n."
+ " The declaration ends with ':' and the whole rule ends with ending-symbol ';'."));
result.add(new CompletionProposal(preSpace + "[] $: ;"
+ lineSeparator, offset, override, 1 + preSpace.length(),
null, "Numbered Rule", null,
"This is the number of the rule. Its an optional information."));
result.add(new CompletionProposal(
preSpace + "$$: ;" + lineSeparator,
offset,
override,
2 + preSpace.length(),
null,
"New technical-nonterminal-declaration",
null,
"\"Technical symbols\" are nonterminal symbols of the grammar which\n"
+ "are not relevant for the understanding process but restrict\n"
+ "word sequences which are allowed by the grammar. They are marked\n"
+ "in the symbol table so that a parser can use this information\n"
+ "when generating the parsing output."));
result.add(new CompletionProposal(
preSpace + "%IGNORE = ;" + lineSeparator,
offset,
override,
10 + preSpace.length(),
null,
"New ignore-rule",
null,
"The \" IGNORE list\" is a list of terminal symbols defined in the\n"
+ "lexicon. A parser can use this list in order to skip some\n"
+ "of these words from the word sequence analysed by the parser.\n"
+ "This may be useful when hesitations like \"er\" should be ignored.\n\n"
+ "An ignore-rule starts with \"%IGNORE =\"\nfollowed by N terminal-symbols and\n"
+ "is closed with closing-symbol \";\"\n\nExample:\n %IGNORE= eh ehm ah er;"));
result.add(new CompletionProposal(
preSpace + "%IGNORE = eh ehm er ah ahm ;" + lineSeparator,
offset,
override,
29 + preSpace.length(),
null,
"Predefined ignore rule.",
null,
"Creates a predefined ignore rule using most used ignore words.\n"
+ "The \" IGNORE list\" is a list of terminal symbols defined in the\n"
+ "lexicon. A parser can use this list in order to skip some\n"
+ "of these words from the word sequence analysed by the parser.\n"
+ "This may be useful when hesitations like \"er\" should be ignored."));
return (ICompletionProposal[]) result
.toArray(new ICompletionProposal[result.size()]);
} catch (Exception e) {
e.printStackTrace();
return NO_COMPLETIONS;
}
}
@Override
public IContextInformation[] computeContextInformation(ITextViewer viewer,
int offset) {
return NO_CONTEXTS;
}
@Override
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
@Override
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
@Override
public IContextInformationValidator getContextInformationValidator() {
return null;
}
@Override
public String getErrorMessage() {
return "ERR";
}
}
package hterhors.editor;
import java.util.ArrayList;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
/**
* @author Hendrik
*/
class ISRContentAssistantIgnoreRuleProcessor implements IContentAssistProcessor {
private final IContextInformation[] NO_CONTEXTS = {};
private ICompletionProposal[] NO_COMPLETIONS = {};
private int override = 0;
private String preSpace = "";
protected static final String lineSeparator = System
.getProperty("line.separator");
/**
* Use this method to set the size for overriding by using content-assistant.
* @param override The size to be override.
* @uml.property name="override"
*/
public void setOverride(int override) {
this.override = override;
}
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
try {
ArrayList<CompletionProposal> result = new ArrayList<CompletionProposal>();
result.add(new CompletionProposal(
preSpace + "newTerminal ",
offset,
override,
preSpace.length(),
null,
"New terminal",
null,
"\"TERMINAL\" symbols are sequences of letters from the set [a-zA-Z_\\-\\\"0-9].\n"
+ "They must be started by a letter from the subset [a-zA-Z_\\\"]."));
return (ICompletionProposal[]) result
.toArray(new ICompletionProposal[result.size()]);
} catch (Exception e) {
e.printStackTrace();
return NO_COMPLETIONS;
}
}
@Override
public IContextInformation[] computeContextInformation(ITextViewer viewer,
int offset) {
return NO_CONTEXTS;
}
@Override
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
@Override
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
@Override
public IContextInformationValidator getContextInformationValidator() {
return null;
}
@Override
public String getErrorMessage() {
return "ERR";
}
}
package hterhors.editor;
import hterhors.editor.markers.IsrRuleValidator;
import java.util.ArrayList;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
/**
* @author Hendrik
*/
class ISRContentAssistantRuleProcessor implements IContentAssistProcessor {
private final IContextInformation[] NO_CONTEXTS = {};
private ICompletionProposal[] NO_COMPLETIONS = {};
private int override = 0;
private String preSpace = "";
protected static final String lineSeparator = System
.getProperty("line.separator");
/**
* Use this method to set the size for overriding by using content-assistant.
* @param override The size to be override.
* @uml.property name="override"
*/
public void setOverride(int override) {
this.override = override;
}
@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int offset) {
try {
IDocument document = viewer.getDocument();
ArrayList<CompletionProposal> result = new ArrayList<CompletionProposal>();
for (String missing : IsrRuleValidator
.getUnusedNonterminals(document.get())) {
result.add(new CompletionProposal(preSpace + "$" + missing
+ " ", offset, override, 2 + missing.length()
+ preSpace.length(), null, missing + " - Unused!",
null, "Add the declared but not used nonterminal ("
+ missing + ")to the rule."));
}
result.add(new CompletionProposal(preSpace + "| ", offset,
override, 2 + preSpace.length(), null, "Or", null,
"Add the or-symbol to the rule."));
result.add(new CompletionProposal(preSpace + "$ ", offset,
override, 1 + preSpace.length(), null, "Nonterminal", null,
"Add New nonterminal-symbol to the current rule."));
result.add(new CompletionProposal(
preSpace + "!*",
offset,
override,
2 + preSpace.length(),
null,
"New joker-symbol",
null,
"\"TERMINAL\" symbols are sequences of letters from the set [a-zA-Z_\\-\\\"0-9].\n"
+ "They must be started by a letter from the subset [a-zA-Z_\\\"].\n"
+ "The joker symbol is denoted by '!*'.\n\n"
+ "The \" joker symbol\" is a special terminal symbol of the grammar which\n"
+ "must not be defined in the lexicon.\n"
+ "If the parser is called with a terminal symbol which is defined\n"
+ "in the lexicon and the corresponding action table entry is empty\n"
+ "it can use this joker symbol in order to get a defined parser\n"
+ "action. The former terminal symbol has to be parsed afterwards.\n"
+ "The joker symbol can be used in the grammar description in order\n"
+ "to define such parser actions. It is handled in the same way\n"
+ "as other terminal symbols defined in the lexicon but does not\n"
+ "correspond to an input symbol. Therefore, it can be called\n"
+ "a virtuell symbol. A special action 'VSHIFT' (virtual shift)\n"
+ "is introduced when generating the action table.\n"
+ "A parser used in a speech recognizer can add a penalty to the \n"
+ "score of the word sequence when shifting the joker symbol. "));
result.add(new CompletionProposal(
preSpace + "newTerminal ",
offset,
override,
preSpace.length(),
null,
"New terminal",
null,
"\"TERMINAL\" symbols are sequences of letters from the set [a-zA-Z_\\-\\\"0-9].\n"
+ "They must be started by a letter from the subset [a-zA-Z_\\\"].\n"
+ "The joker symbol is denoted by '!*'."));
for (String nonterminalDec : IsrRuleValidator
.getNonterminalsDeclarations(document.get())) {
result.add(new CompletionProposal(
preSpace + "$" + nonterminalDec + " ", offset, override, 2
+ nonterminalDec.length() + preSpace.length(), null,
nonterminalDec + " - Existing!", null,
"Add the existing nonterminal ($" + nonterminalDec
+ ") to the rule."));
}
return (ICompletionProposal[]) result
.toArray(new ICompletionProposal[result.size()]);
} catch (Exception e) {
e.printStackTrace();
return NO_COMPLETIONS;
}
}
@Override
public IContextInformation[] computeContextInformation(ITextViewer viewer,
int offset) {
return NO_CONTEXTS;
}
@Override
public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
@Override
public char[] getContextInformationAutoActivationCharacters() {
return null;
}
@Override
public IContextInformationValidator getContextInformationValidator() {
return null;
}
@Override
public String getErrorMessage() {
return "ERR";
}
}
package hterhors.editor;
import hterhors.editor.scanners.ISRPartitionScanner;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.FastPartitioner;
import org.eclipse.ui.editors.text.FileDocumentProvider;
public class ISRDocumentProvider extends FileDocumentProvider {
@Override
protected IDocument createDocument(Object element) throws CoreException {
IDocument document = super.createDocument(element);
if (document != null) {
IDocumentPartitioner partitioner = new FastPartitioner(
new ISRPartitionScanner(), new String[] {
ISRPartitionScanner.ISR_IGNORE,
ISRPartitionScanner.ISR_RULE,
});
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
/**
* @uml.property name="iSRPartitionScanner"
* @uml.associationEnd inverse="iSRDocumentProvider:hterhors.editor.scanners.ISRPartitionScanner"
*/
private ISRPartitionScanner isrPartitionScanner;
/**
* Getter of the property <tt>iSRPartitionScanner</tt>
* @return Returns the isrPartitionScanner.
* @uml.property name="iSRPartitionScanner"
*/
public ISRPartitionScanner getISRPartitionScanner() {
return isrPartitionScanner;
}
/**
* Setter of the property <tt>iSRPartitionScanner</tt>
* @param iSRPartitionScanner The isrPartitionScanner to set.
* @uml.property name="iSRPartitionScanner"
*/
public void setISRPartitionScanner(ISRPartitionScanner isrPartitionScanner) {
this.isrPartitionScanner = isrPartitionScanner;
}
}
\ No newline at end of file