Created
January 24, 2015 11:22
-
-
Save fge/6174f50a3ed03eae061a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.github.parboiled1.grappa.samples; | |
| import org.parboiled.Parboiled; | |
| import org.parboiled.parserunners.BasicParseRunner; | |
| import org.parboiled.parserunners.ParseRunner; | |
| import org.parboiled.support.ParsingResult; | |
| public final class SampleRun | |
| { | |
| public static void main(final String... args) | |
| { | |
| // 1. create a parser | |
| final TestGrammar2 parser = Parboiled.createParser(TestGrammar2.class); | |
| // 2. create a runner | |
| final ParseRunner<String> runner | |
| = new BasicParseRunner<String>(parser.oneLine()); | |
| // 3. collect the result | |
| final ParsingResult<String> result | |
| = runner.run("some input here"); | |
| // 4. success or not? | |
| System.out.println(result.isSuccess()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment