de.tilman.mathParser
Class MathcadParser

java.lang.Object
  extended byde.tilman.mathParser.MathcadParser

public class MathcadParser
extends java.lang.Object

Parses MathML output of Mathcad (2001) into LaTeX using de.tilman.mathParser.mathMLParser.

Technical notes: The class looks for all <div> sections and indentifies the 'mcd:region' property. "TXT" regions are parsed into the output directly, "EQN" regions are passed to and parsed by a MathMLParser object. All quick'n'dirty.

Author:
Tilman Walther, Martin Wilke

Field Summary
(package private)  java.util.LinkedList data
           
(package private)  java.lang.String DIVREGION
           
(package private)  java.io.File inFile
           
(package private)  java.io.BufferedReader inStream
           
(package private)  boolean parseFormatting
           
(package private)  java.lang.StringBuffer resBuf
           
(package private)  java.util.Hashtable substitions
           
(package private)  java.lang.StringBuffer tmpBuf
           
 
Constructor Summary
MathcadParser(java.io.File inFile)
          Parses a MathCAD MathML file into LaTeX.
MathcadParser(java.lang.String filePath)
          Generates a new File object from the given file path and calls constructor.
 
Method Summary
private  java.lang.StringBuffer getDivContent()
           
private  java.lang.StringBuffer getEmbedArea(java.lang.StringBuffer divArea)
           
static void main(java.lang.String[] args)
           
 void parseFormatting(boolean val)
           
private  void saveToFile(java.io.File file)
           
private  void saveToFile(java.lang.String filePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inStream

java.io.BufferedReader inStream

inFile

java.io.File inFile

substitions

java.util.Hashtable substitions

data

java.util.LinkedList data

parseFormatting

boolean parseFormatting

resBuf

java.lang.StringBuffer resBuf

tmpBuf

java.lang.StringBuffer tmpBuf

DIVREGION

final java.lang.String DIVREGION
See Also:
Constant Field Values
Constructor Detail

MathcadParser

public MathcadParser(java.lang.String filePath)
Generates a new File object from the given file path and calls constructor.

Parameters:
filePath - the path of the file to parse

MathcadParser

public MathcadParser(java.io.File inFile)
Parses a MathCAD MathML file into LaTeX.

Parameters:
inFile - the file to parse.
Method Detail

getDivContent

private java.lang.StringBuffer getDivContent()
                                      throws java.io.IOException
Throws:
java.io.IOException

getEmbedArea

private java.lang.StringBuffer getEmbedArea(java.lang.StringBuffer divArea)

saveToFile

private void saveToFile(java.lang.String filePath)

saveToFile

private void saveToFile(java.io.File file)

parseFormatting

public void parseFormatting(boolean val)

main

public static void main(java.lang.String[] args)