Package org.eolang.parser
Class Xmir
- java.lang.Object
-
- org.eolang.parser.Xmir
-
- All Implemented Interfaces:
com.jcabi.xml.XML
public final class Xmir extends Object implements com.jcabi.xml.XML
Prints XMIR to EO or PHI.This class will help you turn XMIR (XML document) into EOLANG plain text source code or PHI calculus expression. It's as simple as this:
String eo = new Xmir(xml).toEO();
String phi = new Xmir(xml).toPhi();
Here, the
xml
is aString
or an instance ofXML
from the jcabi-xml package.
-
-
Constructor Summary
Constructors Constructor Description Xmir(com.jcabi.xml.XML src)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Node
deepCopy()
Node
inner()
com.jcabi.xml.XML
merge(NamespaceContext ctx)
Node
node()
Deprecated.List<com.jcabi.xml.XML>
nodes(String xpath)
com.jcabi.xml.XML
registerNs(String pfx, Object uri)
String
toEO()
Converts XMIR to EO.String
toPhi()
Converts XMIR to PHI.String
toPhi(boolean conservative)
Converts XMIR to PHI.String
toSaltyPhi()
Converts XMIR to PHI without any syntax sugar.String
toString()
Collection<SAXParseException>
validate(com.jcabi.xml.XML xsd)
Collection<SAXParseException>
validate(LSResourceResolver resolver)
List<String>
xpath(String xpath)
-
-
-
Method Detail
-
nodes
public List<com.jcabi.xml.XML> nodes(String xpath)
- Specified by:
nodes
in interfacecom.jcabi.xml.XML
-
registerNs
public com.jcabi.xml.XML registerNs(String pfx, Object uri)
- Specified by:
registerNs
in interfacecom.jcabi.xml.XML
-
merge
public com.jcabi.xml.XML merge(NamespaceContext ctx)
- Specified by:
merge
in interfacecom.jcabi.xml.XML
-
node
@Deprecated public Node node()
Deprecated.- Specified by:
node
in interfacecom.jcabi.xml.XML
-
inner
public Node inner()
- Specified by:
inner
in interfacecom.jcabi.xml.XML
-
deepCopy
public Node deepCopy()
- Specified by:
deepCopy
in interfacecom.jcabi.xml.XML
-
validate
public Collection<SAXParseException> validate(LSResourceResolver resolver)
- Specified by:
validate
in interfacecom.jcabi.xml.XML
-
validate
public Collection<SAXParseException> validate(com.jcabi.xml.XML xsd)
- Specified by:
validate
in interfacecom.jcabi.xml.XML
-
toPhi
public String toPhi(boolean conservative)
Converts XMIR to PHI.- Parameters:
conservative
- Add empty braces to formations or not- Returns:
- PHI representation as
String
.
-
-