Package org.eclipse.jface.text.rules

Examples of org.eclipse.jface.text.rules.MultiLineRule


        //in the following case:
        ///'''<new line>
        //text
        //''' <-- it's already lost at this point and the 'text' will not be in a multiline string partition.

        rules.add(new MultiLineRule("'''", "'''", multiLineString1, '\\', breaksOnEOF));
        rules.add(new MultiLineRule("\"\"\"", "\"\"\"", multiLineString2, '\\', breaksOnEOF));

        //there is a bug in this construct: When parsing a simple document such as:
        //
        //"""ttt"""
        //print 'a'
View Full Code Here


       
        IToken cljChar = new Token(CLOJURE_CHAR);
       
        List<IPredicateRule> rules = new ArrayList<IPredicateRule>();
        rules.add(new EndOfLineRule(";", comment));
        rules.add(new MultiLineRule("\"", "\"", string, '\\'));
        rules.add(new ClojureCharRule(cljChar));
        
        setPredicateRules(rules.toArray(new IPredicateRule[rules.size()]));
    }
View Full Code Here

        // Add rule for links.
        list.add(new SingleLineRule("{", "}", link));

        // multi-line
        list.add(new MultiLineRule("/**", "*/", doc, (char) 0, true));

        // Add generic whitespace rule.
        list.add(new WhitespaceRule(new ApexCodeWhitespaceDetector()));

        if (Utils.isNotEmpty(docKeywords)) {
View Full Code Here

        // Add special case word rule.
        rules.add(new WordPredicateRule(comment));

        // Add rules for multi-line comments.
        rules.add(new MultiLineRule("/*", "*/", comment, (char) 0, true));

        IPredicateRule[] result = new IPredicateRule[rules.size()];
        rules.toArray(result);
        setPredicateRules(result);
    }
View Full Code Here

    ));
       
    List rules = new ArrayList();
   
    // rules.add(new HashExpressionRule(cfnumber));
    rules.add(new MultiLineRule("\"", "\"", string));
    rules.add(new MultiLineRule("'", "'", string));

    //so the script tags look correct
    rules.add(new SingleLineRule("<cfscript", ">", cftag));
    rules.add(new SingleLineRule("</cfscript", ">", cftag));
    rules.add(new SingleLineRule("<CFSCRIPT", ">", cftag));
    rules.add(new SingleLineRule("</CFSCRIPT", ">", cftag));
   
   
    rules.add(new MultiLineRule("/**", "*/", javadoc, (char) 0, true));
    rules.add(new MultiLineRule("/*", "*/", cfcommentBlock, (char) 0, true));
    rules.add(new EndOfLineRule("//", cfcomment));
    rules.add(new NumberRule(cfnumber));
   
    CFSyntaxDictionary dic = (CFSyntaxDictionary)DictionaryManager.getDictionary(DictionaryManager.CFDIC);
   
View Full Code Here

 
   
    //I think the reason this doesnt work as well as the <!-- type of comment
    //is that the <! type is defined on the partition scanner where this is
    //only here... javascript has the same problem
    rules.add(new MultiLineRule("/*", "*/", sqlcomment));
   
    SQLSyntaxDictionary dic = (SQLSyntaxDictionary)DictionaryManager.getDictionary(DictionaryManager.SQLDIC);
     

    //get any SQL specific keywords (select, from, where, et cetra)   
View Full Code Here

    ///////////////////////////////////////////////////////////////////////
   
    IRule[] rules = new IRule[5];
   
    // Add rule for double quotes
    rules[0] = new MultiLineRule("\"", "\"", string);
    rules[1] = new MultiLineRule("'","'",string);
    rules[2] = new NumberRule(cfnumber);
   
    //TODO: Point this to the correct dictionary now.
    //Needs to get the current dictionary for THIS project
    CFSyntaxDictionary cfd = (CFSyntaxDictionary)DictionaryManager.getDictionary(DictionaryManager.CFDIC);
View Full Code Here

    // rules.add(cfScriptRule);
    rules.add(new CFScriptComponentRule("component", "{", CF_START_TAG, CF_TAG_ATTRIBS));
    rules.add(new CFScriptComponentEndRule("}", CF_END_TAG, CF_SCRIPT));
    // rules.add(new CFScriptComponentRule("}", "}", CF_SCRIPT, CF_SCRIPT));
    rules.add(new WordPredicateRule(cfscriptCommentBlock));
    rules.add(new MultiLineRule("/**", "*/", javaDocComment, (char) 0, true));
    rules.add(new MultiLineRule("/*", "*/", cfscriptCommentBlock, (char) 0, true));
    rules.add(new EndOfLineRule("//", cfscriptComment));
    // Partitions in the document will get marked in this order
    rules.add(new NestableMultiLineRule("<!---", "--->", cfComment, (char) 0, true));
    // rules.add(new TagRule(htmComment));
    rules.add(new MultiLineRule("<!--", "-->", htmComment));
    //doctype rule
    rules.add(new MultiLineRule("<!doctype", ">", doctype));
   
    // Handle the if/elsief/set/return tag partitioning
    rules.add(new NamedTagRule("<cfset",">", CF_START_TAG, CF_SET_STATEMENT));
    rules.add(new NamedTagRule("<cfif",">", CF_START_TAG, CF_BOOLEAN_STATEMENT));
    rules.add(new NamedTagRule("<cfelseif",">", CF_START_TAG, CF_BOOLEAN_STATEMENT));
View Full Code Here

    rules.add(new SingleLineRule("</script", ">", scripttag));
   
    rules.add(new SingleLineRule("<SCRIPT", ">", scripttag));
    rules.add(new SingleLineRule("</SCRIPT", ">", scripttag));
   
    rules.add(new MultiLineRule("<cf",">", new Token(CFPartitionScanner.CF_START_TAG)));
    rules.add(new MultiLineRule("<CF",">", new Token(CFPartitionScanner.CF_START_TAG)));
    rules.add(new SingleLineRule("</cf",">", new Token(CFPartitionScanner.CF_END_TAG)));
    rules.add(new SingleLineRule("</CF",">", new Token(CFPartitionScanner.CF_END_TAG)));
   
    JSSyntaxDictionary jssd = (JSSyntaxDictionary)DictionaryManager.getDictionary(DictionaryManager.JSDIC);
   
    ///////////////////////////////////////////////////////////////////////
    //do any keywords
    //get any script specific keywords (if, case, while, et cetra)
    Set set = jssd.getScriptKeywords();
    String allkeys[] = new String[set.size()];
    int i=0;
   
    Iterator it = set.iterator();
    while(it.hasNext())
    {
      allkeys[i++] = (String)it.next();
    }
   
    CFKeywordDetector cfkd = new CFKeywordDetector();
    PredicateWordRule words = new PredicateWordRule(
      cfkd,
      defaulttoken,
      allkeys,
      keyword
    );
   
    ///////////////////////////////////////////////////////////////////////
    //do any known functions
    //get any script specific functions (alert, parseInt, confirm, et cetra)
    set = jssd.getFunctions();
    i=0;
    //String allfuncs[] = new String[set.size()];
    it = set.iterator();
    while(it.hasNext())
    {
      //allfuncs[i++] = (String)it.next();
      String op = (String)it.next();
      //wr.addWord(op,function);
      words.addWord(op,function);
    }
   
    rules.add(words);
   
    ///////////////////////////////////////////////////////////////////////
    //do any operatores
    WordRule wr = new WordRule(new OperatorDetector());
    //get any script specific operators (*, +, =, et cetra)
    set = jssd.getOperators();
    it = set.iterator();
    while(it.hasNext())
    {
      String op = (String)it.next();
      wr.addWord(op,keyword);
    }
    rules.add(wr);
   
    ///////////////////////////////////////////////////////////////////////
    rules.add(new MultiLineRule("/*", "*/", comment));
    rules.add(new EndOfLineRule("//", comment));
   
    rules.add(new SingleLineRule("\"", "\"", string, '\\'));
    rules.add(new SingleLineRule("'", "'", string, '\\'));
   
View Full Code Here

    IRule[] rules = new IRule[3];

    //I think its more important to show cfvariable then to color code the
    // attributes.
    //rules[0] = new SingleLineRule("#", "#", cfvar);
    rules[0] = new MultiLineRule("\"", "\"", string);
    rules[1] = new MultiLineRule("'","'",string);
    // Add generic whitespace rule.
    rules[2] = new ShowWhitespaceRule(new CFWhitespaceDetector());
   
    setRules(rules);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.rules.MultiLineRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.