[Moin-user] csound parser
Jonathan Murphy
typetosmurky at bigpond.com
Thu Feb 8 06:29:47 EST 2007
Hi Folks,
I'm trying to write a Csound parser for the csoundwiki.
http://tobiah.org/csoundwiki/Csound_Home
As a preliminary step, I'm just trying to highlight Csound opcodes and
comments. It's not working and I don't know why. I'm a Python novice,
so I'm hoping that it's something obvious that a more experienced
programmer will be able to point out. This is my effort so far (the
list of opcodes is truncated so that this post isn't too long):
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Csound Parser
@copyright: 2007 Jonathan Murphy
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.util.ParserBase import ParserBase
Dependencies = []
class Parser(ParserBase):
parsername = "ColorizedCsound"
extensions = ['.orc', '.sco', '.csd']
Dependencies = []
def setupRules(self):
ParserBase.setupRules(self)
self.addRulePair("Comment","/[*]","[*]/")
self.addRule("Comment",";.*$")
reserved_words = ['ATSadd',
'ATSaddnz',
'ATSbufread',
'ATScross',
'ATSinfo',
'ATSinterpread',
'ATSpartialtap',
'ATSread',
'ATSreadnz',
'ATSsinnoi']
self.addReserved(reserved_words)
Thanks in advance,
Jonathan.
PS When I say "it isn't working," I just mean that there is no
highlighting, the parser is installed correctly and gives plain text
with line numbers, but that's all. I have put up a test page here:
http://tobiah.org/csoundwiki/TestPage
More information about the Moin-user
mailing list