[api-dev] Little update: a rexx.vim that supports the ooRexx extensions... (Re: [api-dev] Two little suggestions ad http://codesnippets.services.openoffice.org/snippet.dtd

2005-11-20 Thread Rony G. Flatscher

Hi Tom,


If you are running Linux you could search for:
*.vim-Files on my debian it's in: /usr/share/vim/vim64/syntax

The OOBasic(altough not perfect because derived from basic.om) file is
in the cvs and can be found here in cvs where the snippet page resides:
(www/Examples/Snippets/homepage/etc)

If you want I can send it to you offline. You can also take a look in
the document:

http://vimdoc.sourceforge.net/htmldoc/usr_44.html
 

in the meantime I took the existing rexx.vim and after studying your 
links for the documentation (thanks again for them) I was able to come 
up with a newer version, which can highlight the object-oriented 
extensions to Rexx. Did contact the original author of rexx.vim to 
have him check out my version (did change some of his definitions as 
well), but haven't heard back from him yet. Will wait a week or so 
before submitting it to the vim-maintainers for distribution.


Anyway, in case you want to get a look at how that works out, I enclose 
an ooRexx nutshell example from a student which uses the OOo spell 
checker to check a word one enters via the command line.


Regards,

---rony
P.S.: For the time being the new version of rexx.vim resides at 
http://wi.wu-wien.ac.at/rgf/rexx/misc/rexx.vim, so if there is a need 
for updates they would get reflected in that file.


-- Example 29
-- use the SpellChecker to check a word

   /* initialize connection to server, get XContext */
xContext = UNO.connect()  -- connect to server and retrieve the XContext object
XMcf = xContext~getServiceManager   -- retrieve XMultiComponentFactory

SAY *
SAY *** Spell Checker ***
SAY *

SAY Please enter a word: 
parse pull aWord  -- get word to spell check
SAY

   /* create the LinguServiceManager and the SpellChecker */
mxLinguSvcMgrName = 
xMcf~createInstanceWithContext(com.sun.star.linguistic2.LinguServiceManager, 
xContext)
xSpellChecker = mxLinguSvcMgrName~XLinguServiceManager~getSpellChecker

   /* load the required class com.sun.star.lang.Locale and set the language 
to US-english */
CALL UNO.loadClass com.sun.star.lang.Locale
aLocale = .UNO~Locale~new(en, US, )

   /* test the word if it is valid */
isCorrect = xSpellChecker~isValid(aWord, aLocale, .UNO~noProps)

wordCorrect = 
IF isCorrect = 0 THEN wordCorrect = NOT 

say The word ' || aWord || ' is  || wordCorrect || correct!

   /* if the word is not correct submit all alternatives */
xSpellAlternatives = xSpellChecker~spell(aWord, aLocale, .UNO~noProps)

IF xSpellAlternatives  .nil THEN
DO
   SAY
   SAY Alternatives: 
   DO alternative OVER xSpellAlternatives~getAlternatives
  SAY|| alternative
   END
END

::requires UNO.cls-- get UNO support
 Vim syntax file
 Language: Rexx
 Maintainer:   Thomas Geulig [EMAIL PROTECTED]
 Last Change:  2001 May 2
 Last Change:  2005 Nov 19, added some http://www.ooRexx.org-coloring,
line comments, do *over*, messages, directives,
highlighting classes, methods, routines and 
requires
Rony G. Flatscher [EMAIL PROTECTED]

 URL:  http://mywebpage.netscape.com/sharpPeople/vim/syntax/rexx.vim

 Special Thanks to Dan Sharp [EMAIL PROTECTED] for comments and additions
 (and providing the webspace)

 For version 5.x: Clear all syntax items
 For version 6.x: Quit when a syntax file was already loaded
if version  600
  syntax clear
elseif exists(b:current_syntax)
  finish
endif

syn case ignore

 ---rgf, 2005-11-16: turns out, sequence is of utmost importance!
 add to valid identifier chars
setlocal iskeyword+=.
setlocal iskeyword+=!
setlocal iskeyword+=?

 ---rgf, position important: must be before comments etc. !
syn match rexxOperator [-=|\/\\\+\*\[\],;\~]

syn match rexxIdentifier\[a-zA-Z\!\?_]\([a-zA-Z0-9._?!]\)*\
syn match rexxEnvironmentSymbol \\.\+\([a-zA-Z0-9._?!]\)*\


 A Keyword is the first symbol in a clause.  A clause begins at the start
 of a line or after a semicolon.  THEN, ELSE, OTHERWISE, and colons are always
 followed by an implied semicolon.
syn match rexxClause \(^\|;\|:\|then \|else \|otherwise \)\s*\w\+ contains=ALL

 Considered keywords when used together in a phrase and begin a clause

syn region rexxParseWith start=\swithms=s+1 end=\sme=e-1
syn match rexxParse contained 
\parse\s*\(\(upper\|lower\|caseless\)\s*\)\=\(arg\|linein\|pull\|source\|var\|value\|version\)\
 contains=rexxParseWith

syn match rexxKeyword contained \numeric \(digits\|form 
\(scientific\|engineering\|value\)\|fuzz\)\
syn match rexxKeyword contained \\(address\|trace\)\( value\)\=\
syn match rexxKeyword contained \procedure\(\s*expose\)\=\
syn match rexxKeyword contained \do\\(\s*forever\)\=\
syn match rexxKeyword contained \use\\s*\arg\

 Another keyword phrase, separated to aid highlighting in rexxFunction
syn match rexxKeyword contained 

[api-dev] Two little suggestions ad http://codesnippets.services.openoffice.org/snippet.dtd

2005-11-15 Thread Rony G. Flatscher




Hi there,

two short remarks on
http://codesnippets.services.openoffice.org/snippet.dtd.

  ATTLIST for ELEMENT "snippet":
  
  
Starting with OOo 2.0 there are two officially supported
scripting languages missing from the valid values for the "language"
attribute: "BeanShell" and "_javascript_". Due to the availablity of the
scripting framework additional scripting languages are possible, like
"ooRexx" (in beta). Also, "XSL" is now listed as a language on the
snippet site and would be missing from this DTD.
As additional scripting languages can be made available for which
nutshell examples could be supplied, the values for the "language"
attribute should be maintained accordingly. To be able to supply
snippets until the language attribute is updated a value of "Other" may
be helpful together with maybe a new CDATA attribute "otherLanguage"
(or the like) to allow naming the new/unsupported language.

  
  ATTLIST for ELEMENT "operating-systems"
  
  
Same reasoning as with "snippet": there are operating systems
with OOo ported to them that are unlisted, e.g. "OS/2" and
"eComStation", possibly "AIX" and the like. Hence the attribute "name"
should allow for "Other" and possibly add a new CDATA attribute
"other-operating-system" to be able to denote the operating system.
[BTW, shouldn't the ATTLIST denote "operating-systems" (with a trailing
"s" to match the element's name for which the attributre list gets
defined)?]

  

Regards,

---rony








[api-dev] vim.rex already in vim! (Re: [api-dev] Two little suggestions ad http://codesnippets.services.openoffice.org/snippet.dtd

2005-11-15 Thread Rony G. Flatscher




Hi Tom,


  

  3. Adding new languages
  Only adding them to the snippet-DTD is not enough we also have to
  provide Syntax-Highlighting for those languages which means creating
  VIM-Highlight-File which knows how to highlihgt syntax 
  

Where can one find examples for such files (e.g. the ones that are used
for Basic and the like)?

  
  
If you are running Linux you could search for:
*.vim-Files on my debian it's in: /usr/share/vim/vim64/syntax

The OOBasic(altough not perfect because derived from basic.om) file is
in the cvs and can be found here in cvs where the snippet page resides:
(www/Examples/Snippets/homepage/etc)

If you want I can send it to you offline. You can also take a look in
the document:

http://vimdoc.sourceforge.net/htmldoc/usr_44.html
  

Thank you *very* much for your kind hints! 

As it turns out there is a "vim.rex" supplied with vim already (just
checked it). Although it does not highlight the "Open Objet Rexx"
syntax elements, that's not a problem, as the classic Rexx highlighting
already does quite a nice job.

Regards,

---rony