Giter VIP home page Giter VIP logo

doku2latex's Introduction

doku2latex

Dokuwiki to Latex converter

How to install ANTLR4

From "The Definitive ANTLR 4 Reference" by Terence Parr (https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference):

Step 1. Download antlr4 jar from www.antlr.org or

curl -0 http://www.antlr.org/download/antlr-4.6-complete.jar

Step 2. Move antlr-4.6-complete.jar to /usr/local/lib

Step 3. Set CLASSPATH enviroment variable. It could be useful to add this in .bashrc

export CLASSPATH=".:/usr/local/lib/antlr-4.6-complete.jar:$CLASSPATH"

How to use ANTLR4 and parse grammar

You can use the Makefile already created or: # to obtain java files associated with grammar run java -jar /usr/local/lib/antlr-4.6-complete.jar DokuWikiGrammar.g4

# to compile Java files
javac *.java

# to parse a file and generate graphical tree
java org.antlr.v4.runtime.misc.TestRig DokuWikiGrammar wiki_start -gui -input-filename <file_name>

# to parse a fle and generate tokens
java org.antlr.v4.runtime.misc.TestRig DokuWikiGrammar wiki_start -tokens -input-filename <file_name>

# for more options run
java org.antlr.v4.runtime.misc.TestRig

How to compile Doku2Latex Parser

make build

# or
# obtain java files associated with grammars
java -jar /usr/local/lib/antlr-4.6-complete.jar DokuWikiGrammar.g4
java -jar /usr/local/lib/antlr-4.6-complete.jar DokuWikiLinksGrammar.g4
java -jar /usr/local/lib/antlr-4.6-complete.jar DokuWikiListGrammar.g4
java -jar /usr/local/lib/antlr-4.6-complete.jar DokuWikiTablesGrammar.g4

# compile java files with Doku2Latex.java and Doku2LatexListener.java
javac Doku2Latex*.java DokuWikiGrammar*.java SpecialChars.java Utils.java DokuWikiLink*.java DokuWikiList*.java DokuWikiTables*.java

How to run Doku2Latex Parser

java Doku2Latex <file_name>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.