|
INRIA & FluxMedia | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
fr.fluxmedia.transmorpher.parser.FMParser
fr.fluxmedia.transmorpher.parser.ProcessParser
public class ProcessParser
This class allows the creation of a parser for a Transmorpher process. Methods are provided to create a graph corresponding to the process defined in the transmorpher language.
Field Summary | |
---|---|
protected Call |
currentCall
the current call in creation |
protected Iterator |
currentIterator
the current iterator to parse |
protected java.lang.String |
currentParam
the name of the current parameter to parse |
protected Parameters |
currentParams
the current parameters |
protected ModTag |
currentRule
the current rule in creation |
protected Transformation |
currentTransformation
the current transformation in creation |
protected Transmorpher |
currentTransmorpher
the current transmorpher in creation |
protected java.lang.String |
currentWParam
the name of the current with-param to parse |
protected java.util.Hashtable |
imports
to store imported processes |
protected boolean |
inLitteralXSLT
Are we copying some XSLT |
protected boolean |
inQuery
If true , parser is in a query part of the process |
protected boolean |
inRuleSet
If true , parser is in a ruleset part of the process |
protected java.lang.Object[] |
observers
for the GUI (flowcomposer) |
protected QueryParser |
queryParser
a parser for the query |
protected Rule |
rule
a rule |
protected RuleSetParser |
ruleSetParser
a parser for the ruleset |
protected java.lang.String |
tmp
a buffer |
protected java.util.Stack |
tStack
|
protected java.lang.String |
uri
an uri to a process |
Fields inherited from class fr.fluxmedia.transmorpher.parser.FMParser |
---|
debugMode, iContext, output, parser |
Constructor Summary | |
---|---|
ProcessParser(int debugMode)
Creates an XML Parser. |
|
ProcessParser(int debugMode,
java.lang.Object[] observers)
Creates an XML Parser. |
Method Summary | |
---|---|
static java.lang.String[] |
AnalysePortNames(java.lang.String pListe)
Analyzes the port Name attributes "a b c" will be translate to {"a","b","c"} |
void |
characters(char[] ch,
int start,
int length)
This method is used to get data of an element Data are stored in a buffer (tmp) |
void |
checkChannels(Process t)
Checks the channel of the process. |
protected void |
cleanStack()
Resets the parameters as they were after taking care of a Call |
void |
endElement(java.lang.String namespaceURI,
java.lang.String pName,
java.lang.String qName)
Called by the XML parser at the end of an element. |
protected void |
fixBuf(Transformation t,
PortList bufList,
PortList inList,
java.lang.String[] portNames,
int expected)
Creates the buffered ports of a transformation. |
protected void |
fixInPorts(Call c,
PortList list,
java.lang.String[] portNames,
int expected,
java.lang.String type)
Creates the in ports of a call. |
protected void |
fixInPorts(Transformation t,
PortList list,
java.lang.String[] portNames)
Creates the in ports of a transformation. |
protected void |
fixOutBuf(Repeat r,
PortList list,
java.lang.String[] portNames,
int expected)
Creates the out buffered ports of a repeat. |
protected void |
fixOutPorts(Call c,
PortList list,
java.lang.String[] portNames,
int expected,
java.lang.String type)
Creates the out ports of a call. |
protected void |
fixOutPorts(Transformation t,
PortList list,
java.lang.String[] portNames)
Creates the out ports of a transformation. |
java.lang.String |
listAttribute(org.xml.sax.Attributes atts)
Returns a XML-attribute string from the result of such a string |
Transmorpher |
newParse(java.lang.String uri)
Parses the document corresponding to the URI given in parameter If the current process has links (import or include) to others documents then they are parsed. |
void |
registerChannelIn(PortList list,
boolean Callp)
Register a channel with its input The algorithm depends on the context (transformation or call) If we are in a Transformation: the in are input for the channel, they cannot be anything but Channel the out are output for the channel, they cannot be anything but Channel If we are in a Call: the in are output to the channel, they cannot be anything but Channel and _stdin_ the out are input to the channel, they cannot be anything but Channel and _stdout_ or _null_ |
void |
registerChannelOut(PortList list,
boolean Callp)
Register a channel with its output The algorithm depends on the context (transformation or call) If we are in a Transformation: the in are input for the channel, they cannot be anything but Channel the out are output for the channel, they cannot be anything but Channel If we are in a Call: the in are output to the channel, they cannot be anything but Channel and _stdin_ the out are input to the channel, they cannot be anything but Channel and _stdout_ or _null_ |
void |
setEndQuery()
Sets the inQuery flag to false. |
void |
setEndRuleSet()
Sets the inRuleset flag to false. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qname,
org.xml.sax.Attributes atts)
Called by the XML parser at the begining of an element. |
Methods inherited from class fr.fluxmedia.transmorpher.parser.FMParser |
---|
error, fatalError, warning |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String uri
protected java.lang.String tmp
protected Transmorpher currentTransmorpher
protected Transformation currentTransformation
protected Call currentCall
protected ModTag currentRule
protected Rule rule
protected java.lang.String currentParam
protected java.lang.String currentWParam
protected Iterator currentIterator
protected Parameters currentParams
protected java.util.Hashtable imports
protected java.util.Stack tStack
protected java.lang.Object[] observers
protected RuleSetParser ruleSetParser
protected QueryParser queryParser
protected boolean inLitteralXSLT
protected boolean inRuleSet
protected boolean inQuery
Constructor Detail |
---|
public ProcessParser(int debugMode) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
debugMode
- The value of the debug mode
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public ProcessParser(int debugMode, java.lang.Object[] observers) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
debugMode
- The value of the debug modeobservers
- the observers for flowcomposer
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
Method Detail |
---|
public Transmorpher newParse(java.lang.String uri) throws org.xml.sax.SAXException, java.io.IOException
newParse
in class FMParser
uri
- URI of the document to parse
org.xml.sax.SAXException
java.io.IOException
- sends when an IO errors occurspublic void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qname, org.xml.sax.Attributes atts)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
namespaceURI
- The namespace of the current elementlocalName
- The local name of the current elementqname
- The name of the current elementatts
- The attributes name of the current elementpublic void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void setEndRuleSet()
public void setEndQuery()
public void endElement(java.lang.String namespaceURI, java.lang.String pName, java.lang.String qName)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
namespaceURI
- The namespace of the current elementlocalName
- The local name of the current elementqname
- The name of the current elementprotected void fixInPorts(Transformation t, PortList list, java.lang.String[] portNames)
t
- The transformationlist
- The port list which store the in portsportNames
- The names of the ports to createprotected void fixOutPorts(Transformation t, PortList list, java.lang.String[] portNames)
t
- The transformationlist
- The port list which store the out portsportNames
- The names of the ports to createprotected void fixBuf(Transformation t, PortList bufList, PortList inList, java.lang.String[] portNames, int expected)
t
- The transformationbufList
- The port list which store the buffered portsinList
- The port list which store the in portsportNames
- The names of the ports to createexpected
- The required number of portsprotected void fixOutBuf(Repeat r, PortList list, java.lang.String[] portNames, int expected)
r
- The repeatlist
- The port list which store the buffered portsinList
- The port list which store the in portsportNames
- The names of the ports to createexpected
- The required number of portsprotected void fixInPorts(Call c, PortList list, java.lang.String[] portNames, int expected, java.lang.String type)
t
- The calllist
- The port list which store the in portsportNames
- The names of the ports to createexpected
- The required number of portstype
- The type of the callprotected void fixOutPorts(Call c, PortList list, java.lang.String[] portNames, int expected, java.lang.String type)
t
- The calllist
- The port list which store the in portsportNames
- The names of the ports to createexpected
- The required number of portstype
- The type of the callpublic void checkChannels(Process t)
process
- the process to checkpublic void registerChannelIn(PortList list, boolean Callp)
list
- the list of the port to registerCallp
- if true, this is a call, else this is a transformationpublic void registerChannelOut(PortList list, boolean Callp)
list
- the list of the port to registerCallp
- if true, this is a call, else this is a transformationpublic static java.lang.String[] AnalysePortNames(java.lang.String pListe)
pList
- the list of ports names
protected void cleanStack()
public java.lang.String listAttribute(org.xml.sax.Attributes atts)
atts
- attributes to transform
|
INRIA & FluxMedia | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |