Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Could SingleLineRule use a regexp? + How do I partition this grammar?
Could SingleLineRule use a regexp? + How do I partition this grammar? [message #654224] Mon, 14 February 2011 16:24 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 14
Registered: July 2010
Junior Member
First question:

Hi guys! I trying to understand how to make a custom editor in Eclipse using the plugin example with the XML editor. I'm not getting something:
public class XMLPartitionScanner extends RuleBasedPartitionScanner {
	public final static String XML_COMMENT = "__xml_comment";
	public final static String XML_TAG = "__xml_tag";

	public XMLPartitionScanner() {

		IToken xmlComment = new Token(XML_COMMENT);
		IToken tag = new Token(XML_TAG);

		IPredicateRule[] rules = new IPredicateRule[2];

		rules[0] = new MultiLineRule("<!--", "-->", xmlComment);
		rules[1] = new TagRule(tag);

		setPredicateRules(rules);
	}
}


What if in my case a single instruction is something like this?

font( arial, bold, 20) ( (v.degree >= 3 ) AND NOT ( v.label == "Roma" ) )\n


where the last char is the \n but the initial char could be any letter in the alphabet? Could I use a regexp in SingleLineRule?

Second question:
Since my text is a list of instruction like the one above, does it make sense to just have two partition? One for the comments and one for the instructions?

Third question:
I've already have my parser created with sableCC. Is it possibile to integrate it with the editor?

Re: Could SingleLineRule use a regexp? + How do I partition this grammar? [message #729649 is a reply to message #654224] Mon, 26 September 2011 17:28 Go to previous message
Nico is currently offline NicoFriend
Messages: 1
Registered: September 2011
Junior Member
Hi Emanuele i'm facing with the same issue, could you tell me if you were able to resolve it? and what did you do?

Thanks in advance!
Previous Topic:using ImageDescriptor for imported jars
Next Topic:Eclipse randomly closing on Ubuntu 11.04 with no warnings/prompts
Goto Forum:
  


Current Time: Fri Mar 29 01:07:02 GMT 2024

Powered by FUDForum. Page generated in 0.03194 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top