Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » operators highlighting
operators highlighting [message #665777] Fri, 15 April 2011 20:46
bonzo269 is currently offline bonzo269Friend
Messages: 4
Registered: April 2011
Junior Member
I'm creating the ST language editor. I'd like to highlight operators (ex. + - * and so on).

When I add the rules to my Code scanner class it works but only when operators are separate by white space from the other words.
ie. 5 + 6 <- here operator highlights
5+6 <- here it doesn't

I think that probably I must add the rule to my PartitionScanner class. I did it like in code below but it doesn't work. Even text editor doesn't open and I get errors.

Is there any other way to add rule to PartitionScanner class which would operate only on words given?

		List rules= new ArrayList();

		rules.add(new MultiLineRule("(*$VMASM", "*)", kod_vmasm, (char) 0, true ));
		rules.add(new MultiLineRule("(*$", "*)", dyrektywa, (char) 0, true ));
		rules.add(new MultiLineRule("(*@", "*)", dyrektywa_weryfikacji, (char) 0, true ));
		rules.add(new MultiLineRule("(*#", "*)", procedura_specjalna, (char) 0, true ));

		rules.add(new MultiLineRule("(*", "*)", comment, (char) 0, true ));

WordRule wordRule = new WordRule(new STWordDetector(), kod_vmasm);

	    for (int i =0; i < STOperators.length; i++)
	    	wordRule.addWord(STOperators[i], procedura_specjalna);

		IPredicateRule[] result= new IPredicateRule[rules.size()];

Previous Topic:Problem with perspectiveExtensions extensionpoint
Next Topic:prevent file rename/copy/cut/paste/delete in project explorer
Goto Forum:

Current Time: Tue Jun 22 03:10:15 GMT 2021

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

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

Back to the top