4

Wiki Creole Grammar, Schema, and Transformations

 3 years ago
source link: https://dirkriehle.com/publications/2008-selected/wiki-creole/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Wiki Creole Grammar, Schema, and Transformations

Please find below an EBNF grammar, XML schema, and XSLT transformations for Wiki Creole, currently in version 1.0. Wiki Creole is the first (and only) community standard for wiki markup.

These specifications were taken from the following two technical reports:

Wiki Creole EBNF grammar

Wiki Creole XML schema definition

Wiki Creole to XHTML transformation

XML to Wiki Creole transformation

It is pretty likely that despite our test suites, some bugs remain. So, if you find some, please let us know!

The best way to get in contact with us is to address Martin Junghans through the SourceForge WikiCreole project and cc: Dirk Riehle.

Like this:

Loading...

21 Replies to “Wiki Creole Grammar, Schema, and Transformations”

  1. 18c9e611ce51adb751dff8f43ed9c9f8?s=100&d=mm&r=gmarko

    The EBNF links are broken: From the first one “wiki-creole/” must be removed, from the latter the quotation marks at the end.

    Loading...
  2. @marko: Fixed, thank you.

    Loading...
  3. Generating code using ANTLRWorks 1.1.7 results in errors in rule text_bolditalcontent.
    I am a absolute novice on the subject and appreciate your help.

    Loading...
  4. 97713edd75dc39e3e2bf304b627b03a0?s=100&d=mm&r=gMartin

    @Martien
    ANTLRWorks does not always show the same behavior as ANTLR does. I couldn’t use ANTLRWorks for development as the grammar size magnified. Further you’ll probably have to scale up the size of heap memory for code generation, e.g. use the JVM option -Xmx1024M.

    Loading...
  5. Thanks Martin
    Problem solved when generating from the command line using org.antlr.tool.

    Loading...
  6. 3a24f70ee25391933429ae316e082778?s=100&d=mm&r=gV

    Im trying to implement wikicreole using ocamlyacc or menhir (an LR1 parser for OCaml). But Wikicreole’s EBNF is using some ANTLR specific features (I think only this input.LA thing) that makes difficult to adapt to another parser generator … Does somebody have an idea about that?

    Loading...
  7. 97713edd75dc39e3e2bf304b627b03a0?s=100&d=mm&r=gMartin

    V, first you have to consider that ANTLR generates LL(*) parsers, in contrast to your LR(1).
    We had to use the explicit input.LA statements since ANTLR chooses a derivation too early, i.e. even if other derivations are not wrong in respect to the current look-ahead. It does not increase the look-ahead as long as necessary to identify the only applicable derivation. Thus using the wrong derivation will result in an exception, even though the grammar is correct.
    The _grammar_ does not need these explicit queries to the look-ahead. But the _ANTLR grammar specification_ seems to need it auxiliary.
    If I recall LR(1)-parsers correctly, you can’t rely on the grammar specification for your parser generator only, because the WikiCreole language specification needs more look-ahead than 1.
    Nevertheless, good luck for your work!

    Loading...
  8. a3fac016e4b222c1e5ab8a51385cd6b9?s=100&d=mm&r=gGreg

    Hi guys. I’m interested in using this XML format as my intermediate (stored) stage. However, it seems that I’ll have to write the code (Java) to translate from Creole to ‘X-Creole’. I realise there’s an XSD, but would some of you have some example XML files for me to test with? Thanks!

    Loading...
  9. bc614de473743b4bf6a604a1054c6c06?s=100&d=mm&r=gMartin

    Hi Greg, you are right. We do rely on some code to transform a representation of the wiki after parsing to the XML representation. I’m not sure whether you can transform the parse tree (or AST) to XML by ANTLR’s domain specific language. We implemented a Java DFS parse tree walker that generates the XML file simultaneously. Regards, and I mail some files to you.

    Loading...
  10. Greg, Martin: I had been wondering about this for a while—we knew that the tree walker is missing from our publications, but then you can’t really publish some Java code.
    What you can do, of course, is create an open source project. So for that reason I created a SourceForge project called wikicreole a while back. Is there any interest on writing Tree Walker code for that project?

    Loading...
  11. 32056677c9c4a0256cb702dfb0446654?s=100&d=mm&r=gJose Chillan

    Hi,
    I am very interested in your work. I went to the sourceforge project and I saw no file was committed. Is there anywhere I could get the
    Tree Walker for the ANTLR grammar that produces the XML.
    Regards

    Loading...
  12. Hi Jose and everyone,
    The SourceForge Project Wiki Creole Parser is available. It generates scanner and parser from an ANTLR grammar file, parses a wiki page and transforms the parse tree to the XML interchange format.
    Please don’t hesitate to contact me with any questions or comments.

    Loading...
  13. Hello all,
    I had one question, might sound trivial to you. I would like to know whats the different between “with_extension” and “without_extension” in above files..?
    Second, Martin you had mailed (see above comments) Greg some XML documents he asked for, can you mail me the same, please?
    Thanks!

    Loading...
  14. The difference between with_extension and without_extension is that the latter is a grammar (and related files) for the plain original Wiki Creole while with_extension is prepared by way of an additional token to be extended with new syntactic elements. So if all you want is what Wiki Creole 1.0 can give you, use without_extension, if you are thinking about adding your own new syntactic elements try using with_extension. The differences are minimal, just the hook for the extended syntax.
    As to the files, I’ll ask Martin, I think we might have to clean up this page; maybe you can already find what you are looking for at sf.net/projects/wikicreole?

    Loading...
  15. 417c9e6ae0b650449c0e0cee4f9da5a7?s=100&d=mm&r=gLuke

    Hey people, great work..
    .. but:
    I’ve a problem with ANTLR and this grammar. When I try to generate the code via ANTLR 2.7.7 there’s always a nondeterminism between a huge amount of rules..
    which lookahead (k) should i take to wipe these out, but keep the efficiency high?
    thanks!
    luke

    Loading...
  16. 417c9e6ae0b650449c0e0cee4f9da5a7?s=100&d=mm&r=gLuke

    ok.. there’s n other thing i wanted to know..
    when i look past those warnings and try to compile the .java files in the directory, i get 13 errors, every single one about:
    Cannot find symbol
    Symbol: input
    What do I have to do to avoid this one?
    Why doesn’t
    input.LA(1)==DASH
    or sth. work?
    thanks
    luke

    Loading...
  17. Processing the ‘without extensions’ .g file,
    using antlrworks 1.2.3 I’m getting 5 errors and 180 warnings.
    that’s from the command line.
    Has something changed?
    TIA DaveP

    Loading...
  18. 4751992dc8539575ba9313a91887e553?s=100&d=mm&r=gMartin

    Hi Dave,
    we recommend not to use ANTLRworks for generating the scanner/parser. I do not remember why, but using ANTLR from command line is the proper way to go. Maybe you will also have to increase the size of memory for generation.
    Cheers, Martin

    Loading...
  19. I’m having trouble compiling this with ANTLR 3.2 (from the command line as recommended with increased heap size).
    The repeated error I’m seeing (in addition to about a hundred warnings) is “error(201): creole10.g:61:2: The following alternatives can never be matched: 2”.
    Is there a previous verson of ANTLR that will compile this without errors? Or am I barking up a dead tree?

    Loading...
    1. Sorry, we are not actively using ANTLR any longer. We hope to have something much better out for WikiCreole though soon…

      Loading...

Leave a Reply Cancel reply


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK