From 4d38c2bc203899dfdb45067f013caab7bf6c6852 Mon Sep 17 00:00:00 2001 From: Woody Folsom Date: Wed, 14 Nov 2012 11:14:38 -0500 Subject: [PATCH] Able to export SGF files from successful games. --- data/SGF.g | 134 +- data/games/pro9x9/game001.sgf | 2 +- src/net/woodyfolsom/msproj/GameRecord.java | 118 + src/net/woodyfolsom/msproj/GoPlayer.java | 42 + src/net/woodyfolsom/msproj/Referee.java | 25 +- src/net/woodyfolsom/msproj/SGFWriter.java | 46 +- src/net/woodyfolsom/msproj/gui/Goban.java | 70 +- src/net/woodyfolsom/msproj/gui/GridPanel.java | 7 +- .../woodyfolsom/msproj/policy/AlphaBeta.java | 6 + .../msproj/policy/HumanGuiInput.java | 9 +- .../msproj/policy/HumanKeyboardInput.java | 6 + .../woodyfolsom/msproj/policy/Minimax.java | 6 + .../woodyfolsom/msproj/policy/MonteCarlo.java | 6 +- .../msproj/policy/MonteCarloUCT.java | 6 + src/net/woodyfolsom/msproj/policy/Policy.java | 2 + .../msproj/policy/RandomMovePolicy.java | 6 + .../msproj/policy/RootParallelization.java | 6 + src/net/woodyfolsom/msproj/sgf/SGF.tokens | 105 +- .../woodyfolsom/msproj/sgf/SGFGameTree.java | 33 +- .../woodyfolsom/msproj/sgf/SGFIdentifier.java | 14 + src/net/woodyfolsom/msproj/sgf/SGFLexer.java | 3593 ++++--- src/net/woodyfolsom/msproj/sgf/SGFNode.java | 14 +- .../msproj/sgf/SGFNodeCollection.java | 23 +- src/net/woodyfolsom/msproj/sgf/SGFParser.java | 9408 +++++++++-------- .../woodyfolsom/msproj/sgf/SGFProperty.java | 11 + .../1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf | 15 - .../msproj/sgf/CollectionTest.java | 3 +- .../woodyfolsom/msproj/sgf/SGFParserTest.java | 20 + 28 files changed, 7231 insertions(+), 6505 deletions(-) create mode 100644 src/net/woodyfolsom/msproj/GameRecord.java create mode 100644 src/net/woodyfolsom/msproj/GoPlayer.java delete mode 100644 test/net/woodyfolsom/msproj/sgf/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf diff --git a/data/SGF.g b/data/SGF.g index abce28f..e9855e2 100644 --- a/data/SGF.g +++ b/data/SGF.g @@ -44,36 +44,42 @@ $sgfProperty = new SGFProperty(); | (strIdent{$sgfProperty.setIdentifier($strIdent.sgfIdent);}) ((LBRACKET RBRACKET){$sgfProperty.addValue(SGFValue.EMPTY);}) | (strIdent{$sgfProperty.setIdentifier($strIdent.sgfIdent);}) ((LBRACKET strValue RBRACKET){$sgfProperty.addValue(new SGFValue($strValue.text));})+ - | (result{$sgfProperty.setIdentifier(SGFIdentifier.RESULT);}) ((LBRACKET resValue RBRACKET){$sgfProperty.addValue(new SGFValue(new SGFResult($resValue.text)));})+ + | (result{$sgfProperty.setIdentifier(SGFIdentifier.RESULT);}) ((LBRACKET strValue RBRACKET){$sgfProperty.addValue(new SGFValue(new SGFResult($strValue.text)));})+ + | (komi{$sgfProperty.setIdentifier(SGFIdentifier.KOMI);}) ((LBRACKET realValue RBRACKET){$sgfProperty.addValue(new SGFValue(Double.parseDouble($realValue.text)));})+ | (coordIdent{$sgfProperty.setIdentifier($coordIdent.sgfIdent);})((LBRACKET coordValue RBRACKET){$sgfProperty.addValue(new SGFValue(new SGFCoord($coordValue.text)));})+ ; - + //playerIdent is a disambiguating rule playerIdent returns [SGFIdentifier sgfPlayer] : {(input.LT(1).getText().equals("W"))}? strIdent {$sgfPlayer = $strIdent.sgfIdent;} | {(input.LT(1).getText().equals("B"))}? strIdent {$sgfPlayer = $strIdent.sgfIdent;} + | {(input.LT(1).getText().equals("White"))}? strIdent {$sgfPlayer = $strIdent.sgfIdent;} + | {(input.LT(1).getText().equals("Black"))}? strIdent {$sgfPlayer = $strIdent.sgfIdent;} ; strIdent returns [SGFIdentifier sgfIdent] : charEnc{$sgfIdent = SGFIdentifier.CHARSET;} - | source - | blackCountry - | whiteCountry - | event - | playerBlack - | playerWhite - | blackRank - | whiteRank - | result - | rules - | place - | application + | source{$sgfIdent = SGFIdentifier.SOURCE;} + | blackCountry{$sgfIdent = SGFIdentifier.COUNTRY_BLACK;} + | whiteCountry{$sgfIdent = SGFIdentifier.COUNTRY_WHITE;} + | event{$sgfIdent = SGFIdentifier.EVENT;} + | playerBlack{$sgfIdent = SGFIdentifier.PLAYER_BLACK;} + | playerWhite{$sgfIdent = SGFIdentifier.PLAYER_WHITE;} + | blackRank{$sgfIdent = SGFIdentifier.RANK_BLACK;} + | whiteRank{$sgfIdent = SGFIdentifier.RANK_WHITE;} + | rules{$sgfIdent = SGFIdentifier.RULES;} + | place{$sgfIdent = SGFIdentifier.PLACE;} + | application{$sgfIdent = SGFIdentifier.APPLICATION;} | copyright | username - | date + | date{$sgfIdent = SGFIdentifier.DATE;} + | 'Black'{$sgfIdent = SGFIdentifier.MOVE_BLACK;} + | 'White'{$sgfIdent = SGFIdentifier.MOVE_WHITE;} | 'B'{$sgfIdent = SGFIdentifier.MOVE_BLACK;} | 'W'{$sgfIdent = SGFIdentifier.MOVE_WHITE;} + | view{$sgfIdent = SGFIdentifier.VIEW;} //this is not really a strIdent, but is a placeholder since I don't use this info + | comment{$sgfIdent = SGFIdentifier.COMMENT;} //SGF grammar proper allows extensions, but this reader does not ; //if this is matched from rule playerIdent, the value is thrown away - this rule alone //lack the context to disambiguate the single-character player movement IDs. @@ -90,48 +96,65 @@ numIdent returns [SGFIdentifier sgfIdent] | time{$sgfIdent = SGFIdentifier.TIME;}; numValue returns [SGFValue sgfValue] - : (DIGIT+){$sgfValue = new SGFValue(Integer.parseInt($numValue.text));}; - + : (STRVALUE){$sgfValue = new SGFValue(Integer.parseInt($numValue.text));}; + realIdent : komi; - -resValue //'R' is resign - : playerIdent PLUS ('R' | realValue); realValue - : DIGIT+ PERIOD DIGIT+; - + : STRVALUE; + coordValue returns [SGFCoord sgfCoord] - : LCLETTER LCLETTER {$sgfCoord = new SGFCoord($text);} + : STRVALUE {$sgfCoord = new SGFCoord($coordValue.text);} ; fileFormat : 'FF'; -game : 'GM'; -size : 'SZ'; + +game : 'GM' | 'GaMe'; + +size : 'SZ' | 'SiZe'; + +view : 'VW' | 'VieW'; + charEnc : 'CA'; + source : 'SO'; + blackCountry : 'BC'; + whiteCountry : 'WC'; -event : 'EV'; + +event : 'EV' | 'EVent'; + playerBlack - : 'PB'; + : 'PB' | 'PlayerBlack'; playerWhite - : 'PW'; + : 'PW' | 'PlayerWhite'; blackRank : 'BR'; + whiteRank : 'WR'; + komi : 'KM'; -result : 'RE'; + +result : 'RE' + | 'REsult' + ; + rules : 'RU'; -place : 'PC'; + +place : 'PC' | 'PlaCe'; + application : 'AP'; + time : 'TM'; -date : 'DT'; + +date : 'DT' | 'DaTe'; addBlack returns [SGFIdentifier sgfIdent] : 'AB'{$sgfIdent = SGFIdentifier.ADD_BLACK;} @@ -143,19 +166,40 @@ addWhite returns [SGFIdentifier sgfIdent] copyright : 'CP'; + username: 'US'; -strValue : (UCLETTER | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON)+; +comment : 'C'; + +strValue + : (STRVALUE)+; + +SPACE : ' '; + +fragment DIGIT : '0'..'9'; + +COLON : ':'; + +MINUS : '-'; + +fragment PERIOD : '.'; + +COMMA : ','; + +PLUS : '+'; + +SLASH : '/'; + + +STRVALUE : (UCLETTER | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON )+; LPAREN : '(' ; SEMICOLON : ';' ; -UCLETTER : 'A'..'Z'; +fragment UCLETTER : 'A'..'Z'; -LCLETTER : 'a'..'z'; - -DIGIT : '0'..'9'; +fragment LCLETTER : 'a'..'z'; LBRACKET : '['; @@ -165,20 +209,6 @@ RBRACKET RPAREN : ')'; -COLON : ':'; +//CR : '\r'{$channel=HIDDEN;}; -MINUS : '-'; - -SPACE : ' '; - -PERIOD : '.'; - -COMMA : ','; - -PLUS : '+'; - -SLASH : '/'; - -CR : '\r'{$channel=HIDDEN;}; - -NEWLINE : '\n'{$channel=HIDDEN;}; +//NEWLINE : '\n'{$channel=HIDDEN;}; diff --git a/data/games/pro9x9/game001.sgf b/data/games/pro9x9/game001.sgf index defbde7..d6f1e6c 100644 --- a/data/games/pro9x9/game001.sgf +++ b/data/games/pro9x9/game001.sgf @@ -28,7 +28,7 @@ DaTe[1968] PlaCe[] -REsult[Black wins by four points] +REsult[B+4] C[This was the first of a two game match on 9x9, played diff --git a/src/net/woodyfolsom/msproj/GameRecord.java b/src/net/woodyfolsom/msproj/GameRecord.java new file mode 100644 index 0000000..cc5a234 --- /dev/null +++ b/src/net/woodyfolsom/msproj/GameRecord.java @@ -0,0 +1,118 @@ +package net.woodyfolsom.msproj; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GameRecord { + public enum RULES { JAPANESE, CHINESE } + + private GoPlayer playerBlack; + private GoPlayer playerWhite; + //private int numTurns = 0; + private List moves = new ArrayList(); + private List gameStates = new ArrayList(); + private Map> comments = new HashMap>(); + private RULES rules = RULES.CHINESE; + + public GameRecord(GameConfig gameConfig) { + gameStates.add(new GameState(gameConfig)); + //initial 'move' of Action.NONE allows for a game that starts with a board setup + moves.add(Action.NONE); + } + + /** + * Adds a comment for the current turn. + * @param comment + */ + public void addComment(String comment) { + if (comments.containsKey(getNumTurns())) { + comments.get(getNumTurns()).add(comment); + } else { + List newComments = new ArrayList(); + newComments.add(comment); + comments.put(getNumTurns(),newComments); + } + } + + public List getComments(Integer turn) { + if (comments.containsKey(turn)) { + return Collections.unmodifiableList(comments.get(turn)); + } else { + return new ArrayList(0); + } + } + + public GameConfig getGameConfig() { + return gameStates.get(0).getGameConfig(); + } + + public GameState getGameState(Integer turn) { + return gameStates.get(turn); + } + + public Action getMove(int turn) { + return moves.get(turn); + } + + public int getNumTurns() { + return gameStates.size() - 1; + } + + public Player getPlayerToMove(int turn) { + return gameStates.get(turn).getPlayerToMove(); + } + + public Player getPlayerToMove() { + return gameStates.get(getNumTurns()).getPlayerToMove(); + } + + public GameResult getResult() { + return gameStates.get(getNumTurns()).getResult(); + } + + public RULES getRules() { + return rules; + } + + public boolean isFinished() { + return gameStates.get(getNumTurns()).isTerminal(); + } + + public boolean play(Player player, Action action) { + if (isFinished()) { + System.out.println("Unable to play " + action + " as " + player + " because the game is finished."); + return false; //cannot make any more moves, game is over + } + + GameState nextState = new GameState(gameStates.get(getNumTurns())); + if (nextState.playStone(player, action)) { + gameStates.add(nextState); + moves.add(action); + return true; + } else { + //TODO allow relay of an SGF to force making an invalid move? + //It may be possible historically for a mistake to have been made, + //and recorded. + System.out.println("Invalid move" + " by " + player + ": " + action); + return false; //invalid move for this player at this time + } + } + + public void setPlayer(Player player, String name, String country, String rank) { + if (player == Player.BLACK) { + playerBlack = new GoPlayer(); + playerBlack.setName(name); + playerBlack.setRank(rank); + playerBlack.setCountry(country); + } else if (player == Player.WHITE) { + playerWhite = new GoPlayer(); + playerWhite.setName(name); + playerWhite.setRank(rank); + } else { + throw new RuntimeException("Invalid color: " + player); + } + } +} \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/GoPlayer.java b/src/net/woodyfolsom/msproj/GoPlayer.java new file mode 100644 index 0000000..5fb4ed8 --- /dev/null +++ b/src/net/woodyfolsom/msproj/GoPlayer.java @@ -0,0 +1,42 @@ +package net.woodyfolsom.msproj; + + +public class GoPlayer { + private String country; + private String name; + private String rank; + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRank() { + return rank; + } + + public void setRank(String rank) { + this.rank = rank; + } + + public String toSGF(Player color) { + if (color == Player.BLACK) { + return "PB[" + name + "]BR[" + rank + "]BC[" + country + "]"; + } else if (color == Player.WHITE) { + return "PW[" + name + "]WR[" + rank + "]WC[" + country + "]"; + } else { + throw new RuntimeException("Invalid player color: " + color); + } + } +} diff --git a/src/net/woodyfolsom/msproj/Referee.java b/src/net/woodyfolsom/msproj/Referee.java index 3e3334d..cbece3a 100644 --- a/src/net/woodyfolsom/msproj/Referee.java +++ b/src/net/woodyfolsom/msproj/Referee.java @@ -36,18 +36,25 @@ public class Referee { } public GameResult play(GameConfig gameConfig) { - GameState gameState = new GameState(gameConfig); - + GameRecord gameRecord = new GameRecord(gameConfig); + System.out.println("Game started."); try { - while (!gameState.isTerminal()) { + while (!gameRecord.isFinished()) { + GameState gameState = gameRecord.getGameState(gameRecord.getNumTurns()); System.out.println(gameState); - Player currentPlayer = gameState.getPlayerToMove(); - Action action = getPolicy(currentPlayer).getAction(gameConfig, - gameState, currentPlayer); - gameState.playStone(currentPlayer, action); + Player playerToMove = gameRecord.getPlayerToMove(); + Policy policy = getPolicy(playerToMove); + Action action = policy.getAction(gameConfig, + gameState, playerToMove); + + if (gameRecord.play(playerToMove, action)) { + policy.setState(gameRecord.getGameState(gameRecord.getNumTurns())); + } else { + System.out.println("Move rejected - try again."); + } } } catch (Exception ex) { System.out @@ -56,7 +63,7 @@ public class Referee { return GameResult.VOID; } - GameResult result = gameState.getResult(); + GameResult result = gameRecord.getResult(); System.out.println("Game over. Result: " + result); @@ -68,7 +75,7 @@ public class Referee { + ".sgf"); FileOutputStream fos = new FileOutputStream(sgfFile); try { - SGFWriter.writeSGF(gameState, fos); + SGFWriter.write(fos, gameRecord); System.out .println("Game saved as " + sgfFile.getAbsolutePath()); } finally { diff --git a/src/net/woodyfolsom/msproj/SGFWriter.java b/src/net/woodyfolsom/msproj/SGFWriter.java index e14f2bb..356baf1 100644 --- a/src/net/woodyfolsom/msproj/SGFWriter.java +++ b/src/net/woodyfolsom/msproj/SGFWriter.java @@ -2,21 +2,45 @@ package net.woodyfolsom.msproj; import java.io.IOException; import java.io.OutputStream; - -import net.woodyfolsom.msproj.sgf.SGFIdentifier; +import java.io.OutputStreamWriter; public class SGFWriter { - public static void writeSGF(GameState gameState, OutputStream os) + public static void write(OutputStream os, GameRecord gameRecord) throws IOException { - writeNode(os, SGFIdentifier.FILE_FORMAT, Integer.valueOf(4)); - } + OutputStreamWriter writer = new OutputStreamWriter(os); - private static void writeNode(OutputStream os, SGFIdentifier sgfIdent, - Object nodeValue) throws IOException { - os.write(sgfIdent.toString().getBytes()); - os.write("[".getBytes()); - os.write(nodeValue.toString().getBytes()); - os.write("];".getBytes()); + writer.write("("); + + writer.write(";FF[4]GM[1]"); + + GameConfig gameConfig = gameRecord.getGameConfig(); + + writer.write("SZ[" + gameConfig.getSize() + "]"); + writer.write("KM[" + gameConfig.getKomi() + "]"); + + for (int i = 1; i <= gameRecord.getNumTurns(); i++) { + Player player = gameRecord.getPlayerToMove(i-1); + if (Player.BLACK == player) { + writer.write(";B["); + } else if (Player.WHITE == player) { + writer.write(";W["); + } else { + throw new RuntimeException("Invalid player: " + player); + } + Action action = gameRecord.getMove(i); + String sgfCoord; + if (action.isPass()) { + sgfCoord = ""; + } else { + sgfCoord = action.toString().toLowerCase().substring(0,1); + char row = (char) ('a' + gameConfig.getSize() - Integer.valueOf(action.toString().substring(1)).intValue()); + sgfCoord = sgfCoord + row; + } + writer.write(sgfCoord + "]"); + } + + writer.write(")"); + writer.flush(); } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/gui/Goban.java b/src/net/woodyfolsom/msproj/gui/Goban.java index 136a041..05f7088 100644 --- a/src/net/woodyfolsom/msproj/gui/Goban.java +++ b/src/net/woodyfolsom/msproj/gui/Goban.java @@ -1,39 +1,54 @@ package net.woodyfolsom.msproj.gui; import java.awt.BorderLayout; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JButton; import javax.swing.JFrame; +import javax.swing.JPanel; import net.woodyfolsom.msproj.Action; import net.woodyfolsom.msproj.GameConfig; import net.woodyfolsom.msproj.GameState; import net.woodyfolsom.msproj.Player; -public class Goban extends JFrame implements KeyListener { +public class Goban extends JFrame { private static final long serialVersionUID = 1L; - //private GameState gameState; private GridPanel gridPanel; - /* - public static void main(String[] args) { - Goban goban = new Goban(); - goban.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - goban.setVisible(true); - goban.pack(); - }*/ - public Goban(GameConfig gameConfig, Player guiPlayer) { setLayout(new BorderLayout()); this.gridPanel = new GridPanel(gameConfig, guiPlayer); add(gridPanel,BorderLayout.CENTER); - addKeyListener(this); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); + + JButton passBtn = new JButton("Pass"); + JButton resignBtn = new JButton("Resign"); + + passBtn.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent arg0) { + gridPanel.addAction(Action.PASS); + }}); + + resignBtn.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent arg0) { + gridPanel.addAction(Action.RESIGN); + }}); + + JPanel bottomPanel = new JPanel(); + bottomPanel.add(passBtn); + bottomPanel.add(resignBtn); + + add(bottomPanel, BorderLayout.SOUTH); pack(); } @@ -44,32 +59,5 @@ public class Goban extends JFrame implements KeyListener { public void setGameState(GameState gameState) { gridPanel.setGameState(gameState); } - - @Override - public void keyPressed(KeyEvent arg0) { - // TODO Auto-generated method stub - - } - @Override - public void keyReleased(KeyEvent arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void keyTyped(KeyEvent arg0) { - switch (arg0.getKeyChar()) - { - /* - case 't' : - case 'T' : - //Player currentPlayer = GoGame.getNextPlayer(gameState.getPlayerToMove()); - //System.out.println("Switching players. Current player is now " + currentPlayer); - //gameState. - break;*/ - default : - System.out.println("Ignoring unbound key: " + arg0.getKeyChar()); - } - } -} +} \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/gui/GridPanel.java b/src/net/woodyfolsom/msproj/gui/GridPanel.java index a9b0bd3..60751f4 100644 --- a/src/net/woodyfolsom/msproj/gui/GridPanel.java +++ b/src/net/woodyfolsom/msproj/gui/GridPanel.java @@ -76,8 +76,12 @@ public class GridPanel extends JPanel implements MouseListener, } } + public void addAction(Action action) { + actionQueue.add(action); + } + public Action getAction() { - int timeLimit = 10; + int timeLimit = 30; TimeUnit timeUnit = TimeUnit.SECONDS; try { @@ -212,6 +216,7 @@ public class GridPanel extends JPanel implements MouseListener, public void setGameState(GameState gameState) { this.gameState = gameState; + this.repaint(); } @Override diff --git a/src/net/woodyfolsom/msproj/policy/AlphaBeta.java b/src/net/woodyfolsom/msproj/policy/AlphaBeta.java index 1b1aa3d..b79b018 100644 --- a/src/net/woodyfolsom/msproj/policy/AlphaBeta.java +++ b/src/net/woodyfolsom/msproj/policy/AlphaBeta.java @@ -176,4 +176,10 @@ public class AlphaBeta implements Policy { throw new UnsupportedOperationException( "Prohibited actions not supported by this class."); } + + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/policy/HumanGuiInput.java b/src/net/woodyfolsom/msproj/policy/HumanGuiInput.java index 65ce15b..08c159f 100644 --- a/src/net/woodyfolsom/msproj/policy/HumanGuiInput.java +++ b/src/net/woodyfolsom/msproj/policy/HumanGuiInput.java @@ -1,6 +1,5 @@ package net.woodyfolsom.msproj.policy; -import java.io.IOException; import java.util.Collection; import net.woodyfolsom.msproj.Action; @@ -20,7 +19,6 @@ public class HumanGuiInput implements Policy { public Action getAction(GameConfig gameConfig, GameState gameState, Player player) { Action action = null; - String input = ""; do { System.out.println(player @@ -30,8 +28,6 @@ public class HumanGuiInput implements Policy { action = goban.getAction(); if (action.isNone()) { - System.out.println("No move was made within 10 seconds. Hurry up!"); - System.out.println(gameState); continue; } } while (action == null); @@ -51,4 +47,9 @@ public class HumanGuiInput implements Policy { return 1; } + @Override + public void setState(GameState gameState) { + goban.setGameState(gameState); + } + } diff --git a/src/net/woodyfolsom/msproj/policy/HumanKeyboardInput.java b/src/net/woodyfolsom/msproj/policy/HumanKeyboardInput.java index 67fb891..b6cfe9d 100644 --- a/src/net/woodyfolsom/msproj/policy/HumanKeyboardInput.java +++ b/src/net/woodyfolsom/msproj/policy/HumanKeyboardInput.java @@ -70,4 +70,10 @@ public class HumanKeyboardInput implements Policy { return 1; } + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } + } diff --git a/src/net/woodyfolsom/msproj/policy/Minimax.java b/src/net/woodyfolsom/msproj/policy/Minimax.java index 8a422b6..ca3e79a 100644 --- a/src/net/woodyfolsom/msproj/policy/Minimax.java +++ b/src/net/woodyfolsom/msproj/policy/Minimax.java @@ -149,4 +149,10 @@ public class Minimax implements Policy { throw new UnsupportedOperationException( "Prohibited actions not supported by this class."); } + + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/policy/MonteCarlo.java b/src/net/woodyfolsom/msproj/policy/MonteCarlo.java index 6137e94..606dd7d 100644 --- a/src/net/woodyfolsom/msproj/policy/MonteCarlo.java +++ b/src/net/woodyfolsom/msproj/policy/MonteCarlo.java @@ -13,7 +13,7 @@ import net.woodyfolsom.msproj.tree.GameTreeNode; import net.woodyfolsom.msproj.tree.MonteCarloProperties; public abstract class MonteCarlo implements Policy { - protected static final int ROLLOUT_DEPTH_LIMIT = 400; + protected static final int ROLLOUT_DEPTH_LIMIT = 100; protected int numStateEvaluations = 0; protected Policy movePolicy; @@ -113,10 +113,6 @@ public abstract class MonteCarlo implements Policy { return searchTimeLimit; } - public int doRollout() { - return 0; - } - public int getNumStateEvaluations() { return numStateEvaluations; } diff --git a/src/net/woodyfolsom/msproj/policy/MonteCarloUCT.java b/src/net/woodyfolsom/msproj/policy/MonteCarloUCT.java index b57510e..33e8632 100644 --- a/src/net/woodyfolsom/msproj/policy/MonteCarloUCT.java +++ b/src/net/woodyfolsom/msproj/policy/MonteCarloUCT.java @@ -196,4 +196,10 @@ public class MonteCarloUCT extends MonteCarlo { public String toString() { return "MonteCarloUCT"; } + + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/policy/Policy.java b/src/net/woodyfolsom/msproj/policy/Policy.java index 981830b..262aeb7 100644 --- a/src/net/woodyfolsom/msproj/policy/Policy.java +++ b/src/net/woodyfolsom/msproj/policy/Policy.java @@ -15,4 +15,6 @@ public interface Policy { Collection prohibitedActions, Player player); public int getNumStateEvaluations(); + + public void setState(GameState gameState); } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/policy/RandomMovePolicy.java b/src/net/woodyfolsom/msproj/policy/RandomMovePolicy.java index 98c76a5..a81779c 100644 --- a/src/net/woodyfolsom/msproj/policy/RandomMovePolicy.java +++ b/src/net/woodyfolsom/msproj/policy/RandomMovePolicy.java @@ -83,4 +83,10 @@ public class RandomMovePolicy implements Policy, ActionGenerator { Player player) { return getActions(gameConfig, gameState, player, 1).get(0); } + + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/policy/RootParallelization.java b/src/net/woodyfolsom/msproj/policy/RootParallelization.java index bcf99b3..676cc05 100644 --- a/src/net/woodyfolsom/msproj/policy/RootParallelization.java +++ b/src/net/woodyfolsom/msproj/policy/RootParallelization.java @@ -147,4 +147,10 @@ public class RootParallelization implements Policy { qValues = policy.getQvalues(gameConfig, gameState, player); } } + + @Override + public void setState(GameState gameState) { + // TODO Auto-generated method stub + + } } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/sgf/SGF.tokens b/src/net/woodyfolsom/msproj/sgf/SGF.tokens index 6a59685..bdf7aac 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGF.tokens +++ b/src/net/woodyfolsom/msproj/sgf/SGF.tokens @@ -1,3 +1,4 @@ +T__20=20 T__21=21 T__22=22 T__23=23 @@ -24,46 +25,68 @@ T__43=43 T__44=44 T__45=45 T__46=46 +T__47=47 +T__48=48 +T__49=49 +T__50=50 +T__51=51 +T__52=52 +T__53=53 +T__54=54 +T__55=55 +T__56=56 +T__57=57 COLON=4 COMMA=5 -CR=6 -DIGIT=7 -LBRACKET=8 -LCLETTER=9 -LPAREN=10 -MINUS=11 -NEWLINE=12 -PERIOD=13 -PLUS=14 -RBRACKET=15 -RPAREN=16 -SEMICOLON=17 -SLASH=18 -SPACE=19 -UCLETTER=20 -'AB'=21 -'AP'=22 -'AW'=23 -'B'=24 -'BC'=25 -'BR'=26 -'CA'=27 -'CP'=28 -'DT'=29 -'EV'=30 -'FF'=31 -'GM'=32 -'KM'=33 -'PB'=34 -'PC'=35 -'PW'=36 -'R'=37 -'RE'=38 -'RU'=39 -'SO'=40 -'SZ'=41 -'TM'=42 -'US'=43 -'W'=44 -'WC'=45 -'WR'=46 +DIGIT=6 +LBRACKET=7 +LCLETTER=8 +LPAREN=9 +MINUS=10 +PERIOD=11 +PLUS=12 +RBRACKET=13 +RPAREN=14 +SEMICOLON=15 +SLASH=16 +SPACE=17 +STRVALUE=18 +UCLETTER=19 +'AB'=20 +'AP'=21 +'AW'=22 +'B'=23 +'BC'=24 +'BR'=25 +'Black'=26 +'C'=27 +'CA'=28 +'CP'=29 +'DT'=30 +'DaTe'=31 +'EV'=32 +'EVent'=33 +'FF'=34 +'GM'=35 +'GaMe'=36 +'KM'=37 +'PB'=38 +'PC'=39 +'PW'=40 +'PlaCe'=41 +'PlayerBlack'=42 +'PlayerWhite'=43 +'RE'=44 +'REsult'=45 +'RU'=46 +'SO'=47 +'SZ'=48 +'SiZe'=49 +'TM'=50 +'US'=51 +'VW'=52 +'VieW'=53 +'W'=54 +'WC'=55 +'WR'=56 +'White'=57 diff --git a/src/net/woodyfolsom/msproj/sgf/SGFGameTree.java b/src/net/woodyfolsom/msproj/sgf/SGFGameTree.java index 11659d6..a10d8df 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFGameTree.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFGameTree.java @@ -34,7 +34,7 @@ public class SGFGameTree { return subTrees.size(); } - public String toLateXmoves(Player player) { + public String toLateXmoves(Player player, int boardSize) { StringBuilder latexSB = new StringBuilder(); SGFNode.TYPE nodeType; SGFIdentifier sgfIdent; @@ -73,7 +73,8 @@ public class SGFGameTree { } else { latexSB.append(column); } - latexSB.append(19 - sgfCoord.getRow() + 'a'); + char row = sgfCoord.getRow(); + latexSB.append(boardSize - row + 'a'); nMoves++; } if (nMoves == 0) { @@ -83,7 +84,20 @@ public class SGFGameTree { return latexSB.toString(); } - public String toLateX() { + public int getBoardSize() { + for (SGFNode node : nodeSequence) { + SGFNode.TYPE nodeType = node.getType(); + switch (nodeType) { + case ROOT: + return Integer.valueOf(node.getFirstValue(SGFIdentifier.SIZE).getText()); + default: + // ignore + } + } + throw new RuntimeException("Cannot get board size: SGFNode with identifier SZ was not found in any nodeSequence of type ROOT."); + } + + public String toLateX(int boardSize) { StringBuilder latexSB = new StringBuilder(); // Somewhat convoluted logic here because the grammar does not require @@ -97,7 +111,7 @@ public class SGFGameTree { case ROOT: latexSB.append("\\gobansize"); latexSB.append("{"); - latexSB.append(node.getFirstValue(SGFIdentifier.SIZE)); + latexSB.append(boardSize); latexSB.append("}\n"); latexSB.append("\\shortstack{\\showfullgoban\\\\"); SGFResult result = (SGFResult) node.getFirstValue( @@ -120,4 +134,15 @@ public class SGFGameTree { sgfFormatString.append(")"); return sgfFormatString.toString(); } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("("); + for (SGFNode node : nodeSequence) { + stringBuilder.append(node.toString()); + } + stringBuilder.append(")"); + return stringBuilder.toString(); + } } diff --git a/src/net/woodyfolsom/msproj/sgf/SGFIdentifier.java b/src/net/woodyfolsom/msproj/sgf/SGFIdentifier.java index 788c548..d85baa7 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFIdentifier.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFIdentifier.java @@ -3,15 +3,29 @@ package net.woodyfolsom.msproj.sgf; public class SGFIdentifier { public static final SGFIdentifier ADD_BLACK = new SGFIdentifier("AB"); public static final SGFIdentifier ADD_WHITE = new SGFIdentifier("AW"); + public static final SGFIdentifier APPLICATION = new SGFIdentifier("AP"); + public static final SGFIdentifier COUNTRY_BLACK = new SGFIdentifier("BC"); + public static final SGFIdentifier COUNTRY_WHITE = new SGFIdentifier("WC"); public static final SGFIdentifier CHARSET = new SGFIdentifier("CA"); + public static final SGFIdentifier COMMENT = new SGFIdentifier("C"); + public static final SGFIdentifier DATE = new SGFIdentifier("DT"); + public static final SGFIdentifier EVENT = new SGFIdentifier("EV"); public static final SGFIdentifier FILE_FORMAT = new SGFIdentifier("FF"); public static final SGFIdentifier GAME = new SGFIdentifier("GM"); public static final SGFIdentifier KOMI = new SGFIdentifier("KM"); public static final SGFIdentifier MOVE_BLACK = new SGFIdentifier("B"); public static final SGFIdentifier MOVE_WHITE = new SGFIdentifier("W"); + public static final SGFIdentifier PLACE = new SGFIdentifier("PC"); + public static final SGFIdentifier PLAYER_BLACK = new SGFIdentifier("PB"); + public static final SGFIdentifier PLAYER_WHITE = new SGFIdentifier("PW"); + public static final SGFIdentifier RANK_BLACK = new SGFIdentifier("RB"); + public static final SGFIdentifier RANK_WHITE = new SGFIdentifier("RW"); public static final SGFIdentifier RESULT = new SGFIdentifier("RE"); + public static final SGFIdentifier RULES = new SGFIdentifier("RU"); public static final SGFIdentifier SIZE = new SGFIdentifier("SZ"); + public static final SGFIdentifier SOURCE = new SGFIdentifier("SO"); public static final SGFIdentifier TIME = new SGFIdentifier("TM"); + public static final SGFIdentifier VIEW = new SGFIdentifier("VW"); private String text; diff --git a/src/net/woodyfolsom/msproj/sgf/SGFLexer.java b/src/net/woodyfolsom/msproj/sgf/SGFLexer.java index 0aadf6e..97a8d77 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFLexer.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFLexer.java @@ -1,1635 +1,1970 @@ -// $ANTLR 3.4 C:\\Users\\Woody\\Documents\\antlr\\SGF.g 2012-09-25 14:01:14 +// $ANTLR 3.4 C:\\Users\\Woody\\Documents\\antlr\\SGF.g 2012-11-14 04:25:56 package net.woodyfolsom.msproj.sgf; -import org.antlr.runtime.CharStream; -import org.antlr.runtime.Lexer; -import org.antlr.runtime.MismatchedSetException; -import org.antlr.runtime.NoViableAltException; -import org.antlr.runtime.RecognitionException; -import org.antlr.runtime.RecognizerSharedState; +import org.antlr.runtime.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; -@SuppressWarnings({ "all", "warnings", "unchecked" }) +@SuppressWarnings({"all", "warnings", "unchecked"}) public class SGFLexer extends Lexer { - public static final int EOF = -1; - public static final int T__21 = 21; - public static final int T__22 = 22; - public static final int T__23 = 23; - public static final int T__24 = 24; - public static final int T__25 = 25; - public static final int T__26 = 26; - public static final int T__27 = 27; - public static final int T__28 = 28; - public static final int T__29 = 29; - public static final int T__30 = 30; - public static final int T__31 = 31; - public static final int T__32 = 32; - public static final int T__33 = 33; - public static final int T__34 = 34; - public static final int T__35 = 35; - public static final int T__36 = 36; - public static final int T__37 = 37; - public static final int T__38 = 38; - public static final int T__39 = 39; - public static final int T__40 = 40; - public static final int T__41 = 41; - public static final int T__42 = 42; - public static final int T__43 = 43; - public static final int T__44 = 44; - public static final int T__45 = 45; - public static final int T__46 = 46; - public static final int COLON = 4; - public static final int COMMA = 5; - public static final int CR = 6; - public static final int DIGIT = 7; - public static final int LBRACKET = 8; - public static final int LCLETTER = 9; - public static final int LPAREN = 10; - public static final int MINUS = 11; - public static final int NEWLINE = 12; - public static final int PERIOD = 13; - public static final int PLUS = 14; - public static final int RBRACKET = 15; - public static final int RPAREN = 16; - public static final int SEMICOLON = 17; - public static final int SLASH = 18; - public static final int SPACE = 19; - public static final int UCLETTER = 20; - - // delegates - // delegators - public Lexer[] getDelegates() { - return new Lexer[] {}; - } - - public SGFLexer() { - } - - public SGFLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - - public SGFLexer(CharStream input, RecognizerSharedState state) { - super(input, state); - } - - public String getGrammarFileName() { - return "C:\\Users\\Woody\\Documents\\antlr\\SGF.g"; - } - - // $ANTLR start "T__21" - public final void mT__21() throws RecognitionException { - try { - int _type = T__21; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:4:7: ( 'AB' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:4:9: 'AB' - { - match("AB"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__21" - - // $ANTLR start "T__22" - public final void mT__22() throws RecognitionException { - try { - int _type = T__22; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:5:7: ( 'AP' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:5:9: 'AP' - { - match("AP"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__22" - - // $ANTLR start "T__23" - public final void mT__23() throws RecognitionException { - try { - int _type = T__23; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:6:7: ( 'AW' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:6:9: 'AW' - { - match("AW"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__23" - - // $ANTLR start "T__24" - public final void mT__24() throws RecognitionException { - try { - int _type = T__24; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:7: ( 'B' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:9: 'B' - { - match('B'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__24" - - // $ANTLR start "T__25" - public final void mT__25() throws RecognitionException { - try { - int _type = T__25; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:8:7: ( 'BC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:8:9: 'BC' - { - match("BC"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__25" - - // $ANTLR start "T__26" - public final void mT__26() throws RecognitionException { - try { - int _type = T__26; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:9:7: ( 'BR' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:9:9: 'BR' - { - match("BR"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__26" - - // $ANTLR start "T__27" - public final void mT__27() throws RecognitionException { - try { - int _type = T__27; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:10:7: ( 'CA' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:10:9: 'CA' - { - match("CA"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__27" - - // $ANTLR start "T__28" - public final void mT__28() throws RecognitionException { - try { - int _type = T__28; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:7: ( 'CP' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:9: 'CP' - { - match("CP"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__28" - - // $ANTLR start "T__29" - public final void mT__29() throws RecognitionException { - try { - int _type = T__29; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:12:7: ( 'DT' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:12:9: 'DT' - { - match("DT"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__29" - - // $ANTLR start "T__30" - public final void mT__30() throws RecognitionException { - try { - int _type = T__30; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:13:7: ( 'EV' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:13:9: 'EV' - { - match("EV"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__30" - - // $ANTLR start "T__31" - public final void mT__31() throws RecognitionException { - try { - int _type = T__31; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:7: ( 'FF' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:9: 'FF' - { - match("FF"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__31" - - // $ANTLR start "T__32" - public final void mT__32() throws RecognitionException { - try { - int _type = T__32; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:15:7: ( 'GM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:15:9: 'GM' - { - match("GM"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__32" - - // $ANTLR start "T__33" - public final void mT__33() throws RecognitionException { - try { - int _type = T__33; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:16:7: ( 'KM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:16:9: 'KM' - { - match("KM"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__33" - - // $ANTLR start "T__34" - public final void mT__34() throws RecognitionException { - try { - int _type = T__34; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:17:7: ( 'PB' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:17:9: 'PB' - { - match("PB"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__34" - - // $ANTLR start "T__35" - public final void mT__35() throws RecognitionException { - try { - int _type = T__35; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:7: ( 'PC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:9: 'PC' - { - match("PC"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__35" - - // $ANTLR start "T__36" - public final void mT__36() throws RecognitionException { - try { - int _type = T__36; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:19:7: ( 'PW' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:19:9: 'PW' - { - match("PW"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__36" - - // $ANTLR start "T__37" - public final void mT__37() throws RecognitionException { - try { - int _type = T__37; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:20:7: ( 'R' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:20:9: 'R' - { - match('R'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__37" - - // $ANTLR start "T__38" - public final void mT__38() throws RecognitionException { - try { - int _type = T__38; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:7: ( 'RE' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:9: 'RE' - { - match("RE"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__38" - - // $ANTLR start "T__39" - public final void mT__39() throws RecognitionException { - try { - int _type = T__39; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:22:7: ( 'RU' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:22:9: 'RU' - { - match("RU"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__39" - - // $ANTLR start "T__40" - public final void mT__40() throws RecognitionException { - try { - int _type = T__40; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:23:7: ( 'SO' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:23:9: 'SO' - { - match("SO"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__40" - - // $ANTLR start "T__41" - public final void mT__41() throws RecognitionException { - try { - int _type = T__41; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:24:7: ( 'SZ' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:24:9: 'SZ' - { - match("SZ"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__41" - - // $ANTLR start "T__42" - public final void mT__42() throws RecognitionException { - try { - int _type = T__42; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:7: ( 'TM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:9: 'TM' - { - match("TM"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__42" - - // $ANTLR start "T__43" - public final void mT__43() throws RecognitionException { - try { - int _type = T__43; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:26:7: ( 'US' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:26:9: 'US' - { - match("US"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__43" - - // $ANTLR start "T__44" - public final void mT__44() throws RecognitionException { - try { - int _type = T__44; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:7: ( 'W' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:9: 'W' - { - match('W'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__44" - - // $ANTLR start "T__45" - public final void mT__45() throws RecognitionException { - try { - int _type = T__45; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:28:7: ( 'WC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:28:9: 'WC' - { - match("WC"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__45" - - // $ANTLR start "T__46" - public final void mT__46() throws RecognitionException { - try { - int _type = T__46; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:29:7: ( 'WR' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:29:9: 'WR' - { - match("WR"); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "T__46" - - // $ANTLR start "LPAREN" - public final void mLPAREN() throws RecognitionException { - try { - int _type = LPAREN; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:150:9: ( '(' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:150:11: '(' - { - match('('); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "LPAREN" - - // $ANTLR start "SEMICOLON" - public final void mSEMICOLON() throws RecognitionException { - try { - int _type = SEMICOLON; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:152:11: ( ';' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:152:14: ';' - { - match(';'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "SEMICOLON" - - // $ANTLR start "UCLETTER" - public final void mUCLETTER() throws RecognitionException { - try { - int _type = UCLETTER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:154:10: ( 'A' .. 'Z' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: - { - if ((input.LA(1) >= 'A' && input.LA(1) <= 'Z')) { - input.consume(); - } else { - MismatchedSetException mse = new MismatchedSetException( - null, input); - recover(mse); - throw mse; - } - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "UCLETTER" - - // $ANTLR start "LCLETTER" - public final void mLCLETTER() throws RecognitionException { - try { - int _type = LCLETTER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:156:10: ( 'a' .. 'z' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: - { - if ((input.LA(1) >= 'a' && input.LA(1) <= 'z')) { - input.consume(); - } else { - MismatchedSetException mse = new MismatchedSetException( - null, input); - recover(mse); - throw mse; - } - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "LCLETTER" - - // $ANTLR start "DIGIT" - public final void mDIGIT() throws RecognitionException { - try { - int _type = DIGIT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:158:8: ( '0' .. '9' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: - { - if ((input.LA(1) >= '0' && input.LA(1) <= '9')) { - input.consume(); - } else { - MismatchedSetException mse = new MismatchedSetException( - null, input); - recover(mse); - throw mse; - } - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "DIGIT" - - // $ANTLR start "LBRACKET" - public final void mLBRACKET() throws RecognitionException { - try { - int _type = LBRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:161:2: ( '[' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:161:4: '[' - { - match('['); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "LBRACKET" - - // $ANTLR start "RBRACKET" - public final void mRBRACKET() throws RecognitionException { - try { - int _type = RBRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:164:2: ( ']' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:164:4: ']' - { - match(']'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "RBRACKET" - - // $ANTLR start "RPAREN" - public final void mRPAREN() throws RecognitionException { - try { - int _type = RPAREN; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:166:9: ( ')' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:166:11: ')' - { - match(')'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "RPAREN" - - // $ANTLR start "COLON" - public final void mCOLON() throws RecognitionException { - try { - int _type = COLON; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:168:8: ( ':' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:168:10: ':' - { - match(':'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "COLON" - - // $ANTLR start "MINUS" - public final void mMINUS() throws RecognitionException { - try { - int _type = MINUS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:170:8: ( '-' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:170:10: '-' - { - match('-'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "MINUS" - - // $ANTLR start "SPACE" - public final void mSPACE() throws RecognitionException { - try { - int _type = SPACE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:172:8: ( ' ' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:172:10: ' ' - { - match(' '); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "SPACE" - - // $ANTLR start "PERIOD" - public final void mPERIOD() throws RecognitionException { - try { - int _type = PERIOD; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:174:9: ( '.' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:174:11: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "PERIOD" - - // $ANTLR start "COMMA" - public final void mCOMMA() throws RecognitionException { - try { - int _type = COMMA; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:176:8: ( ',' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:176:10: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "COMMA" - - // $ANTLR start "PLUS" - public final void mPLUS() throws RecognitionException { - try { - int _type = PLUS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:178:7: ( '+' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:178:9: '+' - { - match('+'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "PLUS" - - // $ANTLR start "SLASH" - public final void mSLASH() throws RecognitionException { - try { - int _type = SLASH; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:180:8: ( '/' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:180:10: '/' - { - match('/'); - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "SLASH" - - // $ANTLR start "CR" - public final void mCR() throws RecognitionException { - try { - int _type = CR; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:182:5: ( '\\r' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:182:7: '\\r' - { - match('\r'); - - _channel = HIDDEN; - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "CR" - - // $ANTLR start "NEWLINE" - public final void mNEWLINE() throws RecognitionException { - try { - int _type = NEWLINE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:184:9: ( '\\n' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:184:11: '\\n' - { - match('\n'); - - _channel = HIDDEN; - - } - - state.type = _type; - state.channel = _channel; - } finally { - // do for sure before leaving - } - } - - // $ANTLR end "NEWLINE" - - public void mTokens() throws RecognitionException { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:8: ( T__21 | T__22 | - // T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 - // | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | - // T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | LPAREN | - // SEMICOLON | UCLETTER | LCLETTER | DIGIT | LBRACKET | RBRACKET | - // RPAREN | COLON | MINUS | SPACE | PERIOD | COMMA | PLUS | SLASH | CR | - // NEWLINE ) - int alt1 = 43; - switch (input.LA(1)) { - case 'A': { - switch (input.LA(2)) { - case 'B': { - alt1 = 1; - } - break; - case 'P': { - alt1 = 2; - } - break; - case 'W': { - alt1 = 3; - } - break; - default: - alt1 = 29; - } - - } - break; - case 'B': { - switch (input.LA(2)) { - case 'C': { - alt1 = 5; - } - break; - case 'R': { - alt1 = 6; - } - break; - default: - alt1 = 4; - } - - } - break; - case 'C': { - switch (input.LA(2)) { - case 'A': { - alt1 = 7; - } - break; - case 'P': { - alt1 = 8; - } - break; - default: - alt1 = 29; - } - - } - break; - case 'D': { - int LA1_4 = input.LA(2); - - if ((LA1_4 == 'T')) { - alt1 = 9; - } else { - alt1 = 29; - } - } - break; - case 'E': { - int LA1_5 = input.LA(2); - - if ((LA1_5 == 'V')) { - alt1 = 10; - } else { - alt1 = 29; - } - } - break; - case 'F': { - int LA1_6 = input.LA(2); - - if ((LA1_6 == 'F')) { - alt1 = 11; - } else { - alt1 = 29; - } - } - break; - case 'G': { - int LA1_7 = input.LA(2); - - if ((LA1_7 == 'M')) { - alt1 = 12; - } else { - alt1 = 29; - } - } - break; - case 'K': { - int LA1_8 = input.LA(2); - - if ((LA1_8 == 'M')) { - alt1 = 13; - } else { - alt1 = 29; - } - } - break; - case 'P': { - switch (input.LA(2)) { - case 'B': { - alt1 = 14; - } - break; - case 'C': { - alt1 = 15; - } - break; - case 'W': { - alt1 = 16; - } - break; - default: - alt1 = 29; - } - - } - break; - case 'R': { - switch (input.LA(2)) { - case 'E': { - alt1 = 18; - } - break; - case 'U': { - alt1 = 19; - } - break; - default: - alt1 = 17; - } - - } - break; - case 'S': { - switch (input.LA(2)) { - case 'O': { - alt1 = 20; - } - break; - case 'Z': { - alt1 = 21; - } - break; - default: - alt1 = 29; - } - - } - break; - case 'T': { - int LA1_12 = input.LA(2); - - if ((LA1_12 == 'M')) { - alt1 = 22; - } else { - alt1 = 29; - } - } - break; - case 'U': { - int LA1_13 = input.LA(2); - - if ((LA1_13 == 'S')) { - alt1 = 23; - } else { - alt1 = 29; - } - } - break; - case 'W': { - switch (input.LA(2)) { - case 'C': { - alt1 = 25; - } - break; - case 'R': { - alt1 = 26; - } - break; - default: - alt1 = 24; - } - - } - break; - case '(': { - alt1 = 27; - } - break; - case ';': { - alt1 = 28; - } - break; - case 'H': - case 'I': - case 'J': - case 'L': - case 'M': - case 'N': - case 'O': - case 'Q': - case 'V': - case 'X': - case 'Y': - case 'Z': { - alt1 = 29; - } - break; - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': { - alt1 = 30; - } - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': { - alt1 = 31; - } - break; - case '[': { - alt1 = 32; - } - break; - case ']': { - alt1 = 33; - } - break; - case ')': { - alt1 = 34; - } - break; - case ':': { - alt1 = 35; - } - break; - case '-': { - alt1 = 36; - } - break; - case ' ': { - alt1 = 37; - } - break; - case '.': { - alt1 = 38; - } - break; - case ',': { - alt1 = 39; - } - break; - case '+': { - alt1 = 40; - } - break; - case '/': { - alt1 = 41; - } - break; - case '\r': { - alt1 = 42; - } - break; - case '\n': { - alt1 = 43; - } - break; - default: - NoViableAltException nvae = new NoViableAltException("", 1, 0, - input); - - throw nvae; - - } - - switch (alt1) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:10: T__21 - { - mT__21(); - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:16: T__22 - { - mT__22(); - - } - break; - case 3: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:22: T__23 - { - mT__23(); - - } - break; - case 4: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:28: T__24 - { - mT__24(); - - } - break; - case 5: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:34: T__25 - { - mT__25(); - - } - break; - case 6: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:40: T__26 - { - mT__26(); - - } - break; - case 7: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:46: T__27 - { - mT__27(); - - } - break; - case 8: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:52: T__28 - { - mT__28(); - - } - break; - case 9: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:58: T__29 - { - mT__29(); - - } - break; - case 10: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:64: T__30 - { - mT__30(); - - } - break; - case 11: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:70: T__31 - { - mT__31(); - - } - break; - case 12: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:76: T__32 - { - mT__32(); - - } - break; - case 13: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:82: T__33 - { - mT__33(); - - } - break; - case 14: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:88: T__34 - { - mT__34(); - - } - break; - case 15: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:94: T__35 - { - mT__35(); - - } - break; - case 16: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:100: T__36 - { - mT__36(); - - } - break; - case 17: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:106: T__37 - { - mT__37(); - - } - break; - case 18: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:112: T__38 - { - mT__38(); - - } - break; - case 19: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:118: T__39 - { - mT__39(); - - } - break; - case 20: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:124: T__40 - { - mT__40(); - - } - break; - case 21: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:130: T__41 - { - mT__41(); - - } - break; - case 22: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:136: T__42 - { - mT__42(); - - } - break; - case 23: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:142: T__43 - { - mT__43(); - - } - break; - case 24: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:148: T__44 - { - mT__44(); - - } - break; - case 25: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:154: T__45 - { - mT__45(); - - } - break; - case 26: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:160: T__46 - { - mT__46(); - - } - break; - case 27: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:166: LPAREN - { - mLPAREN(); - - } - break; - case 28: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:173: SEMICOLON - { - mSEMICOLON(); - - } - break; - case 29: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:183: UCLETTER - { - mUCLETTER(); - - } - break; - case 30: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:192: LCLETTER - { - mLCLETTER(); - - } - break; - case 31: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:201: DIGIT - { - mDIGIT(); - - } - break; - case 32: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:207: LBRACKET - { - mLBRACKET(); - - } - break; - case 33: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:216: RBRACKET - { - mRBRACKET(); - - } - break; - case 34: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:225: RPAREN - { - mRPAREN(); - - } - break; - case 35: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:232: COLON - { - mCOLON(); - - } - break; - case 36: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:238: MINUS - { - mMINUS(); - - } - break; - case 37: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:244: SPACE - { - mSPACE(); - - } - break; - case 38: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:250: PERIOD - { - mPERIOD(); - - } - break; - case 39: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:257: COMMA - { - mCOMMA(); - - } - break; - case 40: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:263: PLUS - { - mPLUS(); - - } - break; - case 41: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:268: SLASH - { - mSLASH(); - - } - break; - case 42: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:274: CR - { - mCR(); - - } - break; - case 43: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:277: NEWLINE - { - mNEWLINE(); - - } - break; - - } - - } + public static final int EOF=-1; + public static final int T__20=20; + public static final int T__21=21; + public static final int T__22=22; + public static final int T__23=23; + public static final int T__24=24; + public static final int T__25=25; + public static final int T__26=26; + public static final int T__27=27; + public static final int T__28=28; + public static final int T__29=29; + public static final int T__30=30; + public static final int T__31=31; + public static final int T__32=32; + public static final int T__33=33; + public static final int T__34=34; + public static final int T__35=35; + public static final int T__36=36; + public static final int T__37=37; + public static final int T__38=38; + public static final int T__39=39; + public static final int T__40=40; + public static final int T__41=41; + public static final int T__42=42; + public static final int T__43=43; + public static final int T__44=44; + public static final int T__45=45; + public static final int T__46=46; + public static final int T__47=47; + public static final int T__48=48; + public static final int T__49=49; + public static final int T__50=50; + public static final int T__51=51; + public static final int T__52=52; + public static final int T__53=53; + public static final int T__54=54; + public static final int T__55=55; + public static final int T__56=56; + public static final int T__57=57; + public static final int COLON=4; + public static final int COMMA=5; + public static final int DIGIT=6; + public static final int LBRACKET=7; + public static final int LCLETTER=8; + public static final int LPAREN=9; + public static final int MINUS=10; + public static final int PERIOD=11; + public static final int PLUS=12; + public static final int RBRACKET=13; + public static final int RPAREN=14; + public static final int SEMICOLON=15; + public static final int SLASH=16; + public static final int SPACE=17; + public static final int STRVALUE=18; + public static final int UCLETTER=19; + + // delegates + // delegators + public Lexer[] getDelegates() { + return new Lexer[] {}; + } + + public SGFLexer() {} + public SGFLexer(CharStream input) { + this(input, new RecognizerSharedState()); + } + public SGFLexer(CharStream input, RecognizerSharedState state) { + super(input,state); + } + public String getGrammarFileName() { return "C:\\Users\\Woody\\Documents\\antlr\\SGF.g"; } + + // $ANTLR start "T__20" + public final void mT__20() throws RecognitionException { + try { + int _type = T__20; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:4:7: ( 'AB' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:4:9: 'AB' + { + match("AB"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__20" + + // $ANTLR start "T__21" + public final void mT__21() throws RecognitionException { + try { + int _type = T__21; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:5:7: ( 'AP' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:5:9: 'AP' + { + match("AP"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__21" + + // $ANTLR start "T__22" + public final void mT__22() throws RecognitionException { + try { + int _type = T__22; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:6:7: ( 'AW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:6:9: 'AW' + { + match("AW"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__22" + + // $ANTLR start "T__23" + public final void mT__23() throws RecognitionException { + try { + int _type = T__23; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:7: ( 'B' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:9: 'B' + { + match('B'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__23" + + // $ANTLR start "T__24" + public final void mT__24() throws RecognitionException { + try { + int _type = T__24; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:8:7: ( 'BC' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:8:9: 'BC' + { + match("BC"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__24" + + // $ANTLR start "T__25" + public final void mT__25() throws RecognitionException { + try { + int _type = T__25; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:9:7: ( 'BR' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:9:9: 'BR' + { + match("BR"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__25" + + // $ANTLR start "T__26" + public final void mT__26() throws RecognitionException { + try { + int _type = T__26; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:10:7: ( 'Black' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:10:9: 'Black' + { + match("Black"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__26" + + // $ANTLR start "T__27" + public final void mT__27() throws RecognitionException { + try { + int _type = T__27; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:7: ( 'C' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:9: 'C' + { + match('C'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__27" + + // $ANTLR start "T__28" + public final void mT__28() throws RecognitionException { + try { + int _type = T__28; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:12:7: ( 'CA' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:12:9: 'CA' + { + match("CA"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__28" + + // $ANTLR start "T__29" + public final void mT__29() throws RecognitionException { + try { + int _type = T__29; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:13:7: ( 'CP' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:13:9: 'CP' + { + match("CP"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__29" + + // $ANTLR start "T__30" + public final void mT__30() throws RecognitionException { + try { + int _type = T__30; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:7: ( 'DT' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:9: 'DT' + { + match("DT"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__30" + + // $ANTLR start "T__31" + public final void mT__31() throws RecognitionException { + try { + int _type = T__31; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:15:7: ( 'DaTe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:15:9: 'DaTe' + { + match("DaTe"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__31" + + // $ANTLR start "T__32" + public final void mT__32() throws RecognitionException { + try { + int _type = T__32; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:16:7: ( 'EV' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:16:9: 'EV' + { + match("EV"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__32" + + // $ANTLR start "T__33" + public final void mT__33() throws RecognitionException { + try { + int _type = T__33; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:17:7: ( 'EVent' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:17:9: 'EVent' + { + match("EVent"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__33" + + // $ANTLR start "T__34" + public final void mT__34() throws RecognitionException { + try { + int _type = T__34; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:7: ( 'FF' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:9: 'FF' + { + match("FF"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__34" + + // $ANTLR start "T__35" + public final void mT__35() throws RecognitionException { + try { + int _type = T__35; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:19:7: ( 'GM' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:19:9: 'GM' + { + match("GM"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__35" + + // $ANTLR start "T__36" + public final void mT__36() throws RecognitionException { + try { + int _type = T__36; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:20:7: ( 'GaMe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:20:9: 'GaMe' + { + match("GaMe"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__36" + + // $ANTLR start "T__37" + public final void mT__37() throws RecognitionException { + try { + int _type = T__37; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:7: ( 'KM' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:9: 'KM' + { + match("KM"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__37" + + // $ANTLR start "T__38" + public final void mT__38() throws RecognitionException { + try { + int _type = T__38; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:22:7: ( 'PB' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:22:9: 'PB' + { + match("PB"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__38" + + // $ANTLR start "T__39" + public final void mT__39() throws RecognitionException { + try { + int _type = T__39; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:23:7: ( 'PC' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:23:9: 'PC' + { + match("PC"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__39" + + // $ANTLR start "T__40" + public final void mT__40() throws RecognitionException { + try { + int _type = T__40; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:24:7: ( 'PW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:24:9: 'PW' + { + match("PW"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__40" + + // $ANTLR start "T__41" + public final void mT__41() throws RecognitionException { + try { + int _type = T__41; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:7: ( 'PlaCe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:9: 'PlaCe' + { + match("PlaCe"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__41" + + // $ANTLR start "T__42" + public final void mT__42() throws RecognitionException { + try { + int _type = T__42; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:26:7: ( 'PlayerBlack' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:26:9: 'PlayerBlack' + { + match("PlayerBlack"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__42" + + // $ANTLR start "T__43" + public final void mT__43() throws RecognitionException { + try { + int _type = T__43; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:7: ( 'PlayerWhite' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:9: 'PlayerWhite' + { + match("PlayerWhite"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__43" + + // $ANTLR start "T__44" + public final void mT__44() throws RecognitionException { + try { + int _type = T__44; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:28:7: ( 'RE' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:28:9: 'RE' + { + match("RE"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__44" + + // $ANTLR start "T__45" + public final void mT__45() throws RecognitionException { + try { + int _type = T__45; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:29:7: ( 'REsult' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:29:9: 'REsult' + { + match("REsult"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__45" + + // $ANTLR start "T__46" + public final void mT__46() throws RecognitionException { + try { + int _type = T__46; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:30:7: ( 'RU' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:30:9: 'RU' + { + match("RU"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__46" + + // $ANTLR start "T__47" + public final void mT__47() throws RecognitionException { + try { + int _type = T__47; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:7: ( 'SO' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:9: 'SO' + { + match("SO"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__47" + + // $ANTLR start "T__48" + public final void mT__48() throws RecognitionException { + try { + int _type = T__48; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:32:7: ( 'SZ' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:32:9: 'SZ' + { + match("SZ"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__48" + + // $ANTLR start "T__49" + public final void mT__49() throws RecognitionException { + try { + int _type = T__49; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:33:7: ( 'SiZe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:33:9: 'SiZe' + { + match("SiZe"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__49" + + // $ANTLR start "T__50" + public final void mT__50() throws RecognitionException { + try { + int _type = T__50; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:34:7: ( 'TM' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:34:9: 'TM' + { + match("TM"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__50" + + // $ANTLR start "T__51" + public final void mT__51() throws RecognitionException { + try { + int _type = T__51; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:35:7: ( 'US' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:35:9: 'US' + { + match("US"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__51" + + // $ANTLR start "T__52" + public final void mT__52() throws RecognitionException { + try { + int _type = T__52; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:36:7: ( 'VW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:36:9: 'VW' + { + match("VW"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__52" + + // $ANTLR start "T__53" + public final void mT__53() throws RecognitionException { + try { + int _type = T__53; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:7: ( 'VieW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:9: 'VieW' + { + match("VieW"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__53" + + // $ANTLR start "T__54" + public final void mT__54() throws RecognitionException { + try { + int _type = T__54; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:38:7: ( 'W' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:38:9: 'W' + { + match('W'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__54" + + // $ANTLR start "T__55" + public final void mT__55() throws RecognitionException { + try { + int _type = T__55; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:39:7: ( 'WC' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:39:9: 'WC' + { + match("WC"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__55" + + // $ANTLR start "T__56" + public final void mT__56() throws RecognitionException { + try { + int _type = T__56; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:7: ( 'WR' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:9: 'WR' + { + match("WR"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__56" + + // $ANTLR start "T__57" + public final void mT__57() throws RecognitionException { + try { + int _type = T__57; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:7: ( 'White' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:9: 'White' + { + match("White"); + + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__57" + + // $ANTLR start "SPACE" + public final void mSPACE() throws RecognitionException { + try { + int _type = SPACE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:177:8: ( ' ' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:177:10: ' ' + { + match(' '); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "SPACE" + + // $ANTLR start "DIGIT" + public final void mDIGIT() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:179:17: ( '0' .. '9' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + + + } + + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "DIGIT" + + // $ANTLR start "COLON" + public final void mCOLON() throws RecognitionException { + try { + int _type = COLON; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:181:8: ( ':' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:181:10: ':' + { + match(':'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COLON" + + // $ANTLR start "MINUS" + public final void mMINUS() throws RecognitionException { + try { + int _type = MINUS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:183:8: ( '-' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:183:10: '-' + { + match('-'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "MINUS" + + // $ANTLR start "PERIOD" + public final void mPERIOD() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:185:18: ( '.' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:185:20: '.' + { + match('.'); + + } + + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "PERIOD" + + // $ANTLR start "COMMA" + public final void mCOMMA() throws RecognitionException { + try { + int _type = COMMA; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:187:8: ( ',' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:187:10: ',' + { + match(','); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COMMA" + + // $ANTLR start "PLUS" + public final void mPLUS() throws RecognitionException { + try { + int _type = PLUS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:189:7: ( '+' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:189:9: '+' + { + match('+'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "PLUS" + + // $ANTLR start "SLASH" + public final void mSLASH() throws RecognitionException { + try { + int _type = SLASH; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:191:8: ( '/' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:191:10: '/' + { + match('/'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "SLASH" + + // $ANTLR start "STRVALUE" + public final void mSTRVALUE() throws RecognitionException { + try { + int _type = STRVALUE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:194:10: ( ( UCLETTER | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON )+ ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:194:12: ( UCLETTER | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:194:12: ( UCLETTER | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON )+ + int cnt1=0; + loop1: + do { + int alt1=2; + int LA1_0 = input.LA(1); + + if ( (LA1_0==' '||(LA1_0 >= '+' && LA1_0 <= ':')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { + alt1=1; + } + + + switch (alt1) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( input.LA(1)==' '||(input.LA(1) >= '+' && input.LA(1) <= ':')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + + + } + break; + + default : + if ( cnt1 >= 1 ) break loop1; + EarlyExitException eee = + new EarlyExitException(1, input); + throw eee; + } + cnt1++; + } while (true); + + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "STRVALUE" + + // $ANTLR start "LPAREN" + public final void mLPAREN() throws RecognitionException { + try { + int _type = LPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:196:9: ( '(' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:196:11: '(' + { + match('('); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LPAREN" + + // $ANTLR start "SEMICOLON" + public final void mSEMICOLON() throws RecognitionException { + try { + int _type = SEMICOLON; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:198:11: ( ';' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:198:14: ';' + { + match(';'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "SEMICOLON" + + // $ANTLR start "UCLETTER" + public final void mUCLETTER() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:200:19: ( 'A' .. 'Z' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + + + } + + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "UCLETTER" + + // $ANTLR start "LCLETTER" + public final void mLCLETTER() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:202:19: ( 'a' .. 'z' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + + + } + + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LCLETTER" + + // $ANTLR start "LBRACKET" + public final void mLBRACKET() throws RecognitionException { + try { + int _type = LBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:205:2: ( '[' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:205:4: '[' + { + match('['); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LBRACKET" + + // $ANTLR start "RBRACKET" + public final void mRBRACKET() throws RecognitionException { + try { + int _type = RBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:208:2: ( ']' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:208:4: ']' + { + match(']'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RBRACKET" + + // $ANTLR start "RPAREN" + public final void mRPAREN() throws RecognitionException { + try { + int _type = RPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:210:9: ( ')' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:210:11: ')' + { + match(')'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RPAREN" + + public void mTokens() throws RecognitionException { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:8: ( T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | T__57 | SPACE | COLON | MINUS | COMMA | PLUS | SLASH | STRVALUE | LPAREN | SEMICOLON | LBRACKET | RBRACKET | RPAREN ) + int alt2=50; + alt2 = dfa2.predict(input); + switch (alt2) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:10: T__20 + { + mT__20(); + + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:16: T__21 + { + mT__21(); + + + } + break; + case 3 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:22: T__22 + { + mT__22(); + + + } + break; + case 4 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:28: T__23 + { + mT__23(); + + + } + break; + case 5 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:34: T__24 + { + mT__24(); + + + } + break; + case 6 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:40: T__25 + { + mT__25(); + + + } + break; + case 7 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:46: T__26 + { + mT__26(); + + + } + break; + case 8 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:52: T__27 + { + mT__27(); + + + } + break; + case 9 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:58: T__28 + { + mT__28(); + + + } + break; + case 10 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:64: T__29 + { + mT__29(); + + + } + break; + case 11 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:70: T__30 + { + mT__30(); + + + } + break; + case 12 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:76: T__31 + { + mT__31(); + + + } + break; + case 13 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:82: T__32 + { + mT__32(); + + + } + break; + case 14 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:88: T__33 + { + mT__33(); + + + } + break; + case 15 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:94: T__34 + { + mT__34(); + + + } + break; + case 16 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:100: T__35 + { + mT__35(); + + + } + break; + case 17 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:106: T__36 + { + mT__36(); + + + } + break; + case 18 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:112: T__37 + { + mT__37(); + + + } + break; + case 19 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:118: T__38 + { + mT__38(); + + + } + break; + case 20 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:124: T__39 + { + mT__39(); + + + } + break; + case 21 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:130: T__40 + { + mT__40(); + + + } + break; + case 22 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:136: T__41 + { + mT__41(); + + + } + break; + case 23 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:142: T__42 + { + mT__42(); + + + } + break; + case 24 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:148: T__43 + { + mT__43(); + + + } + break; + case 25 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:154: T__44 + { + mT__44(); + + + } + break; + case 26 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:160: T__45 + { + mT__45(); + + + } + break; + case 27 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:166: T__46 + { + mT__46(); + + + } + break; + case 28 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:172: T__47 + { + mT__47(); + + + } + break; + case 29 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:178: T__48 + { + mT__48(); + + + } + break; + case 30 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:184: T__49 + { + mT__49(); + + + } + break; + case 31 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:190: T__50 + { + mT__50(); + + + } + break; + case 32 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:196: T__51 + { + mT__51(); + + + } + break; + case 33 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:202: T__52 + { + mT__52(); + + + } + break; + case 34 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:208: T__53 + { + mT__53(); + + + } + break; + case 35 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:214: T__54 + { + mT__54(); + + + } + break; + case 36 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:220: T__55 + { + mT__55(); + + + } + break; + case 37 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:226: T__56 + { + mT__56(); + + + } + break; + case 38 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:232: T__57 + { + mT__57(); + + + } + break; + case 39 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:238: SPACE + { + mSPACE(); + + + } + break; + case 40 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:244: COLON + { + mCOLON(); + + + } + break; + case 41 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:250: MINUS + { + mMINUS(); + + + } + break; + case 42 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:256: COMMA + { + mCOMMA(); + + + } + break; + case 43 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:262: PLUS + { + mPLUS(); + + + } + break; + case 44 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:267: SLASH + { + mSLASH(); + + + } + break; + case 45 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:273: STRVALUE + { + mSTRVALUE(); + + + } + break; + case 46 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:282: LPAREN + { + mLPAREN(); + + + } + break; + case 47 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:289: SEMICOLON + { + mSEMICOLON(); + + + } + break; + case 48 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:299: LBRACKET + { + mLBRACKET(); + + + } + break; + case 49 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:308: RBRACKET + { + mRBRACKET(); + + + } + break; + case 50 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:1:317: RPAREN + { + mRPAREN(); + + + } + break; + + } + + } + + + protected DFA2 dfa2 = new DFA2(this); + static final String DFA2_eotS = + "\1\uffff\1\26\1\42\1\45\13\26\1\75\1\76\1\77\1\100\1\101\1\102\1"+ + "\103\6\uffff\1\104\1\105\1\106\1\107\1\110\1\26\1\uffff\1\112\1"+ + "\113\1\uffff\1\114\1\26\1\117\1\120\1\121\1\26\1\123\1\124\1\125"+ + "\1\126\1\26\1\131\1\132\1\133\1\134\1\26\1\136\1\137\1\140\1\26"+ + "\1\142\1\143\1\26\14\uffff\1\26\3\uffff\2\26\3\uffff\1\26\4\uffff"+ + "\2\26\4\uffff\1\26\3\uffff\1\26\2\uffff\2\26\1\160\1\26\1\162\3"+ + "\26\1\166\1\167\1\26\1\171\1\uffff\1\172\1\uffff\1\173\2\26\2\uffff"+ + "\1\176\3\uffff\1\26\1\u0081\1\uffff\2\26\1\uffff\6\26\1\u008a\1"+ + "\u008b\2\uffff"; + static final String DFA2_eofS = + "\u008c\uffff"; + static final String DFA2_minS = + "\1\40\1\102\2\40\1\124\1\126\1\106\2\115\1\102\1\105\1\117\1\115"+ + "\1\123\1\127\7\40\6\uffff\5\40\1\141\1\uffff\2\40\1\uffff\1\40\1"+ + "\124\3\40\1\115\4\40\1\141\4\40\1\132\3\40\1\145\2\40\1\151\14\uffff"+ + "\1\143\3\uffff\1\145\1\156\3\uffff\1\145\4\uffff\1\103\1\165\4\uffff"+ + "\1\145\3\uffff\1\127\2\uffff\1\164\1\153\1\40\1\164\1\40\2\145\1"+ + "\154\2\40\1\145\1\40\1\uffff\1\40\1\uffff\1\40\1\162\1\164\2\uffff"+ + "\1\40\3\uffff\1\102\1\40\1\uffff\1\154\1\150\1\uffff\1\141\1\151"+ + "\1\143\1\164\1\153\1\145\2\40\2\uffff"; + static final String DFA2_maxS = + "\1\172\1\127\2\172\1\141\1\126\1\106\1\141\1\115\1\154\1\125\1\151"+ + "\1\115\1\123\1\151\7\172\6\uffff\5\172\1\141\1\uffff\2\172\1\uffff"+ + "\1\172\1\124\3\172\1\115\4\172\1\141\4\172\1\132\3\172\1\145\2\172"+ + "\1\151\14\uffff\1\143\3\uffff\1\145\1\156\3\uffff\1\145\4\uffff"+ + "\1\171\1\165\4\uffff\1\145\3\uffff\1\127\2\uffff\1\164\1\153\1\172"+ + "\1\164\1\172\2\145\1\154\2\172\1\145\1\172\1\uffff\1\172\1\uffff"+ + "\1\172\1\162\1\164\2\uffff\1\172\3\uffff\1\127\1\172\1\uffff\1\154"+ + "\1\150\1\uffff\1\141\1\151\1\143\1\164\1\153\1\145\2\172\2\uffff"; + static final String DFA2_acceptS = + "\26\uffff\1\55\1\56\1\57\1\60\1\61\1\62\6\uffff\1\4\2\uffff\1\10"+ + "\27\uffff\1\43\1\47\1\50\1\51\1\52\1\53\1\54\1\1\1\2\1\3\1\5\1\6"+ + "\1\uffff\1\11\1\12\1\13\2\uffff\1\15\1\17\1\20\1\uffff\1\22\1\23"+ + "\1\24\1\25\2\uffff\1\31\1\33\1\34\1\35\1\uffff\1\37\1\40\1\41\1"+ + "\uffff\1\44\1\45\14\uffff\1\14\1\uffff\1\21\3\uffff\1\36\1\42\1"+ + "\uffff\1\7\1\16\1\26\2\uffff\1\46\2\uffff\1\32\10\uffff\1\27\1\30"; + static final String DFA2_specialS = + "\u008c\uffff}>"; + static final String[] DFA2_transitionS = { + "\1\20\7\uffff\1\27\1\33\1\uffff\1\24\1\23\1\22\1\26\1\25\12"+ + "\26\1\21\1\30\5\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\3\26\1\10"+ + "\4\26\1\11\1\26\1\12\1\13\1\14\1\15\1\16\1\17\3\26\1\31\1\uffff"+ + "\1\32\3\uffff\32\26", + "\1\34\15\uffff\1\35\6\uffff\1\36", + "\1\26\12\uffff\20\26\6\uffff\2\26\1\37\16\26\1\40\10\26\6\uffff"+ + "\13\26\1\41\16\26", + "\1\26\12\uffff\20\26\6\uffff\1\43\16\26\1\44\12\26\6\uffff"+ + "\32\26", + "\1\46\14\uffff\1\47", + "\1\50", + "\1\51", + "\1\52\23\uffff\1\53", + "\1\54", + "\1\55\1\56\23\uffff\1\57\24\uffff\1\60", + "\1\61\17\uffff\1\62", + "\1\63\12\uffff\1\64\16\uffff\1\65", + "\1\66", + "\1\67", + "\1\70\21\uffff\1\71", + "\1\26\12\uffff\20\26\6\uffff\2\26\1\72\16\26\1\73\10\26\6\uffff"+ + "\7\26\1\74\22\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "", + "", + "", + "", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\111", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\115", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\4\26\1\116\25\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\122", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\127", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\22\26\1\130\7\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\135", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\141", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\144", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\1\145", + "", + "", + "", + "\1\146", + "\1\147", + "", + "", + "", + "\1\150", + "", + "", + "", + "", + "\1\151\65\uffff\1\152", + "\1\153", + "", + "", + "", + "", + "\1\154", + "", + "", + "", + "\1\155", + "", + "", + "\1\156", + "\1\157", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\161", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\163", + "\1\164", + "\1\165", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\170", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\174", + "\1\175", + "", + "", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "", + "", + "\1\177\24\uffff\1\u0080", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "\1\u0082", + "\1\u0083", + "", + "\1\u0084", + "\1\u0085", + "\1\u0086", + "\1\u0087", + "\1\u0088", + "\1\u0089", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "\1\26\12\uffff\20\26\6\uffff\32\26\6\uffff\32\26", + "", + "" + }; + + static final short[] DFA2_eot = DFA.unpackEncodedString(DFA2_eotS); + static final short[] DFA2_eof = DFA.unpackEncodedString(DFA2_eofS); + static final char[] DFA2_min = DFA.unpackEncodedStringToUnsignedChars(DFA2_minS); + static final char[] DFA2_max = DFA.unpackEncodedStringToUnsignedChars(DFA2_maxS); + static final short[] DFA2_accept = DFA.unpackEncodedString(DFA2_acceptS); + static final short[] DFA2_special = DFA.unpackEncodedString(DFA2_specialS); + static final short[][] DFA2_transition; + + static { + int numStates = DFA2_transitionS.length; + DFA2_transition = new short[numStates][]; + for (int i=0; i properties = new ArrayList(); @@ -18,6 +18,8 @@ public class SGFNode { type = TYPE.MOVE_BLACK; } else if (sgfIdent == SGFIdentifier.MOVE_WHITE) { type = TYPE.MOVE_WHITE; + } else if (sgfIdent == SGFIdentifier.COMMENT) { + type = TYPE.COMMENT; } else { type = TYPE.ROOT; } @@ -59,4 +61,14 @@ public class SGFNode { return sgfFormatString; } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(";"); + for (SGFProperty property : properties) { + stringBuilder.append(property.toString()); + } + return stringBuilder.toString(); + } } diff --git a/src/net/woodyfolsom/msproj/sgf/SGFNodeCollection.java b/src/net/woodyfolsom/msproj/sgf/SGFNodeCollection.java index ff09c82..c77b590 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFNodeCollection.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFNodeCollection.java @@ -24,25 +24,30 @@ public class SGFNodeCollection { StringBuilder latexFormatString = new StringBuilder(""); SGFGameTree gameTree = gameTrees.get(0); - latexFormatString.append(gameTree.toLateXmoves(Player.BLACK)); - latexFormatString.append(gameTree.toLateXmoves(Player.WHITE)); + int boardSize = gameTree.getBoardSize(); + latexFormatString.append(gameTree.toLateXmoves(Player.BLACK, boardSize)); + latexFormatString.append(gameTree.toLateXmoves(Player.WHITE, boardSize)); latexFormatString.append("\\begin{center}\n"); - latexFormatString.append(gameTree.toLateX()); + latexFormatString.append(gameTree.toLateX(boardSize)); latexFormatString.append("\\end{center}"); return latexFormatString.toString(); } + /** + * This method is an alias for toString(). + * @return + */ public String toSGF() { - String sgfFormatString = ""; - for (SGFGameTree gameTree : gameTrees) { - sgfFormatString += gameTree.toSGF(); - } - return sgfFormatString; + return toString(); } @Override public String toString() { - return toSGF(); + StringBuilder sbuilder = new StringBuilder(); + for (SGFGameTree gameTree : gameTrees) { + sbuilder.append(gameTree.toString()); + } + return sbuilder.toString(); } } diff --git a/src/net/woodyfolsom/msproj/sgf/SGFParser.java b/src/net/woodyfolsom/msproj/sgf/SGFParser.java index 5739ee2..f01c250 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFParser.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFParser.java @@ -1,4 +1,4 @@ -// $ANTLR 3.4 C:\\Users\\Woody\\Documents\\antlr\\SGF.g 2012-09-25 14:01:13 +// $ANTLR 3.4 C:\\Users\\Woody\\Documents\\antlr\\SGF.g 2012-11-14 04:25:56 package net.woodyfolsom.msproj.sgf; import org.antlr.runtime.*; @@ -6,4694 +6,4740 @@ import java.util.Stack; import java.util.List; import java.util.ArrayList; -@SuppressWarnings({ "all", "warnings", "unchecked" }) +@SuppressWarnings({"all", "warnings", "unchecked"}) public class SGFParser extends Parser { - public static final String[] tokenNames = new String[] { "", - "", "", "", "COLON", "COMMA", "CR", "DIGIT", - "LBRACKET", "LCLETTER", "LPAREN", "MINUS", "NEWLINE", "PERIOD", - "PLUS", "RBRACKET", "RPAREN", "SEMICOLON", "SLASH", "SPACE", - "UCLETTER", "'AB'", "'AP'", "'AW'", "'B'", "'BC'", "'BR'", "'CA'", - "'CP'", "'DT'", "'EV'", "'FF'", "'GM'", "'KM'", "'PB'", "'PC'", - "'PW'", "'R'", "'RE'", "'RU'", "'SO'", "'SZ'", "'TM'", "'US'", - "'W'", "'WC'", "'WR'" }; - - public static final int EOF = -1; - public static final int T__21 = 21; - public static final int T__22 = 22; - public static final int T__23 = 23; - public static final int T__24 = 24; - public static final int T__25 = 25; - public static final int T__26 = 26; - public static final int T__27 = 27; - public static final int T__28 = 28; - public static final int T__29 = 29; - public static final int T__30 = 30; - public static final int T__31 = 31; - public static final int T__32 = 32; - public static final int T__33 = 33; - public static final int T__34 = 34; - public static final int T__35 = 35; - public static final int T__36 = 36; - public static final int T__37 = 37; - public static final int T__38 = 38; - public static final int T__39 = 39; - public static final int T__40 = 40; - public static final int T__41 = 41; - public static final int T__42 = 42; - public static final int T__43 = 43; - public static final int T__44 = 44; - public static final int T__45 = 45; - public static final int T__46 = 46; - public static final int COLON = 4; - public static final int COMMA = 5; - public static final int CR = 6; - public static final int DIGIT = 7; - public static final int LBRACKET = 8; - public static final int LCLETTER = 9; - public static final int LPAREN = 10; - public static final int MINUS = 11; - public static final int NEWLINE = 12; - public static final int PERIOD = 13; - public static final int PLUS = 14; - public static final int RBRACKET = 15; - public static final int RPAREN = 16; - public static final int SEMICOLON = 17; - public static final int SLASH = 18; - public static final int SPACE = 19; - public static final int UCLETTER = 20; - - // delegates - public Parser[] getDelegates() { - return new Parser[] {}; - } - - // delegators - - public SGFParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - - public SGFParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - } - - public String[] getTokenNames() { - return SGFParser.tokenNames; - } - - public String getGrammarFileName() { - return "C:\\Users\\Woody\\Documents\\antlr\\SGF.g"; - } - - // $ANTLR start "collection" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:1: collection returns - // [SGFNodeCollection sgfNodeCollection] : ( gameTree )+ ; - public final SGFNodeCollection collection() throws RecognitionException { - SGFNodeCollection sgfNodeCollection = null; - - SGFGameTree gameTree1 = null; - - sgfNodeCollection = new SGFNodeCollection(); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:2: ( ( gameTree )+ ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:4: ( gameTree )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:4: ( gameTree )+ - int cnt1 = 0; - loop1: do { - int alt1 = 2; - int LA1_0 = input.LA(1); - - if ((LA1_0 == LPAREN)) { - alt1 = 1; - } - - switch (alt1) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:5: gameTree - { - pushFollow(FOLLOW_gameTree_in_collection36); - gameTree1 = gameTree(); - - state._fsp--; - - sgfNodeCollection.add(gameTree1); - - } - break; - - default: - if (cnt1 >= 1) - break loop1; - EarlyExitException eee = new EarlyExitException(1, - input); - throw eee; - } - cnt1++; - } while (true); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfNodeCollection; - } - - // $ANTLR end "collection" - - // $ANTLR start "gameTree" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:1: gameTree returns - // [SGFGameTree sgfGameTree] : LPAREN sequence ( gameTree )* RPAREN ; - public final SGFGameTree gameTree() throws RecognitionException { - SGFGameTree sgfGameTree = null; - - List sequence2 = null; - - sgfGameTree = new SGFGameTree(); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:2: ( LPAREN sequence - // ( gameTree )* RPAREN ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:5: LPAREN sequence ( - // gameTree )* RPAREN - { - match(input, LPAREN, FOLLOW_LPAREN_in_gameTree61); - - pushFollow(FOLLOW_sequence_in_gameTree63); - sequence2 = sequence(); - - state._fsp--; - - sgfGameTree.setNodeSequence(sequence2); - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:76: ( gameTree - // )* - loop2: do { - int alt2 = 2; - int LA2_0 = input.LA(1); - - if ((LA2_0 == LPAREN)) { - alt2 = 1; - } - - switch (alt2) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:77: gameTree - { - pushFollow(FOLLOW_gameTree_in_gameTree67); - gameTree(); - - state._fsp--; - - sgfGameTree.addSubTree(sgfGameTree); - - } - break; - - default: - break loop2; - } - } while (true); - - match(input, RPAREN, FOLLOW_RPAREN_in_gameTree72); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfGameTree; - } - - // $ANTLR end "gameTree" - - // $ANTLR start "sequence" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:1: sequence returns - // [List nodeSequence] : ( node )+ ; - public final List sequence() throws RecognitionException { - List nodeSequence = null; - - SGFNode node3 = null; - - nodeSequence = new ArrayList(); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:2: ( ( node )+ ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:4: ( node )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:4: ( node )+ - int cnt3 = 0; - loop3: do { - int alt3 = 2; - int LA3_0 = input.LA(1); - - if ((LA3_0 == SEMICOLON)) { - alt3 = 1; - } - - switch (alt3) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:5: node - { - pushFollow(FOLLOW_node_in_sequence94); - node3 = node(); - - state._fsp--; - - nodeSequence.add(node3); - - } - break; - - default: - if (cnt3 >= 1) - break loop3; - EarlyExitException eee = new EarlyExitException(3, - input); - throw eee; - } - cnt3++; - } while (true); + public static final String[] tokenNames = new String[] { + "", "", "", "", "COLON", "COMMA", "DIGIT", "LBRACKET", "LCLETTER", "LPAREN", "MINUS", "PERIOD", "PLUS", "RBRACKET", "RPAREN", "SEMICOLON", "SLASH", "SPACE", "STRVALUE", "UCLETTER", "'AB'", "'AP'", "'AW'", "'B'", "'BC'", "'BR'", "'Black'", "'C'", "'CA'", "'CP'", "'DT'", "'DaTe'", "'EV'", "'EVent'", "'FF'", "'GM'", "'GaMe'", "'KM'", "'PB'", "'PC'", "'PW'", "'PlaCe'", "'PlayerBlack'", "'PlayerWhite'", "'RE'", "'REsult'", "'RU'", "'SO'", "'SZ'", "'SiZe'", "'TM'", "'US'", "'VW'", "'VieW'", "'W'", "'WC'", "'WR'", "'White'" + }; + + public static final int EOF=-1; + public static final int T__20=20; + public static final int T__21=21; + public static final int T__22=22; + public static final int T__23=23; + public static final int T__24=24; + public static final int T__25=25; + public static final int T__26=26; + public static final int T__27=27; + public static final int T__28=28; + public static final int T__29=29; + public static final int T__30=30; + public static final int T__31=31; + public static final int T__32=32; + public static final int T__33=33; + public static final int T__34=34; + public static final int T__35=35; + public static final int T__36=36; + public static final int T__37=37; + public static final int T__38=38; + public static final int T__39=39; + public static final int T__40=40; + public static final int T__41=41; + public static final int T__42=42; + public static final int T__43=43; + public static final int T__44=44; + public static final int T__45=45; + public static final int T__46=46; + public static final int T__47=47; + public static final int T__48=48; + public static final int T__49=49; + public static final int T__50=50; + public static final int T__51=51; + public static final int T__52=52; + public static final int T__53=53; + public static final int T__54=54; + public static final int T__55=55; + public static final int T__56=56; + public static final int T__57=57; + public static final int COLON=4; + public static final int COMMA=5; + public static final int DIGIT=6; + public static final int LBRACKET=7; + public static final int LCLETTER=8; + public static final int LPAREN=9; + public static final int MINUS=10; + public static final int PERIOD=11; + public static final int PLUS=12; + public static final int RBRACKET=13; + public static final int RPAREN=14; + public static final int SEMICOLON=15; + public static final int SLASH=16; + public static final int SPACE=17; + public static final int STRVALUE=18; + public static final int UCLETTER=19; + + // delegates + public Parser[] getDelegates() { + return new Parser[] {}; + } + + // delegators + + + public SGFParser(TokenStream input) { + this(input, new RecognizerSharedState()); + } + public SGFParser(TokenStream input, RecognizerSharedState state) { + super(input, state); + } + + public String[] getTokenNames() { return SGFParser.tokenNames; } + public String getGrammarFileName() { return "C:\\Users\\Woody\\Documents\\antlr\\SGF.g"; } + + + + // $ANTLR start "collection" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:7:1: collection returns [SGFNodeCollection sgfNodeCollection] : ( gameTree )+ ; + public final SGFNodeCollection collection() throws RecognitionException { + SGFNodeCollection sgfNodeCollection = null; + + + SGFGameTree gameTree1 =null; + + + + sgfNodeCollection = new SGFNodeCollection(); + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:2: ( ( gameTree )+ ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:4: ( gameTree )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:4: ( gameTree )+ + int cnt1=0; + loop1: + do { + int alt1=2; + int LA1_0 = input.LA(1); + + if ( (LA1_0==LPAREN) ) { + alt1=1; + } + - } + switch (alt1) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:11:5: gameTree + { + pushFollow(FOLLOW_gameTree_in_collection36); + gameTree1=gameTree(); - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } + state._fsp--; - finally { - // do for sure before leaving - } - return nodeSequence; - } - // $ANTLR end "sequence" + sgfNodeCollection.add(gameTree1); - // $ANTLR start "node" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:1: node returns [SGFNode - // sgfNode] : SEMICOLON ( property )* ; - public final SGFNode node() throws RecognitionException { - SGFNode sgfNode = null; + } + break; - SGFProperty property4 = null; + default : + if ( cnt1 >= 1 ) break loop1; + EarlyExitException eee = + new EarlyExitException(1, input); + throw eee; + } + cnt1++; + } while (true); - sgfNode = new SGFNode(); - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:2: ( SEMICOLON ( - // property )* ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:4: SEMICOLON ( - // property )* - { - match(input, SEMICOLON, FOLLOW_SEMICOLON_in_node115); - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:14: ( property - // )* - loop4: do { - int alt4 = 2; - int LA4_0 = input.LA(1); - - if (((LA4_0 >= 21 && LA4_0 <= 36) || (LA4_0 >= 38 && LA4_0 <= 46))) { - alt4 = 1; - } - - switch (alt4) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:15: property - { - pushFollow(FOLLOW_property_in_node118); - property4 = property(); - - state._fsp--; - - sgfNode.addProperty(property4); - - } - break; - - default: - break loop4; - } - } while (true); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfNode; - } - - // $ANTLR end "node" - - // $ANTLR start "property" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:33:1: property returns - // [SGFProperty sgfProperty] : ( ( numIdent ) ( ( LBRACKET numValue RBRACKET - // ) )+ | ( playerIdent ) ( ( LBRACKET RBRACKET ) )+ | ( playerIdent ) ( ( - // LBRACKET coordValue RBRACKET ) )+ | ( strIdent ) ( ( LBRACKET RBRACKET ) - // ) | ( strIdent ) ( ( LBRACKET strValue RBRACKET ) )+ | ( result ) ( ( - // LBRACKET resValue RBRACKET ) )+ | ( komi ) ( ( LBRACKET realValue - // RBRACKET ) )+ | ( coordIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ ); - public final SGFProperty property() throws RecognitionException { - SGFProperty sgfProperty = null; - - SGFIdentifier numIdent5 = null; - - SGFParser.numValue_return numValue6 = null; - - SGFIdentifier playerIdent7 = null; - - SGFIdentifier playerIdent8 = null; - - SGFParser.coordValue_return coordValue9 = null; - - SGFIdentifier strIdent10 = null; - - SGFIdentifier strIdent11 = null; - - SGFParser.strValue_return strValue12 = null; - - SGFParser.resValue_return resValue13 = null; - - SGFParser.realValue_return realValue14 = null; - - SGFIdentifier coordIdent15 = null; - - SGFParser.coordValue_return coordValue16 = null; - - sgfProperty = new SGFProperty(); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:2: ( ( numIdent ) ( - // ( LBRACKET numValue RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET - // RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET coordValue RBRACKET - // ) )+ | ( strIdent ) ( ( LBRACKET RBRACKET ) ) | ( strIdent ) ( ( - // LBRACKET strValue RBRACKET ) )+ | ( result ) ( ( LBRACKET - // resValue RBRACKET ) )+ | ( komi ) ( ( LBRACKET realValue RBRACKET - // ) )+ | ( coordIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ ) - int alt12 = 8; - switch (input.LA(1)) { - case 31: - case 32: - case 41: - case 42: { - alt12 = 1; - } - break; - case 27: { - int LA12_2 = input.LA(2); - - if ((LA12_2 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 2, input); - - throw nvae; - - } - } - break; - case 40: { - int LA12_3 = input.LA(2); - - if ((LA12_3 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 3, input); - - throw nvae; - - } - } - break; - case 25: { - int LA12_4 = input.LA(2); - - if ((LA12_4 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 4, input); - - throw nvae; - - } - } - break; - case 45: { - int LA12_5 = input.LA(2); - - if ((LA12_5 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 5, input); - - throw nvae; - - } - } - break; - case 30: { - int LA12_6 = input.LA(2); - - if ((LA12_6 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 6, input); - - throw nvae; - - } - } - break; - case 34: { - int LA12_7 = input.LA(2); - - if ((LA12_7 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 7, input); - - throw nvae; - - } - } - break; - case 36: { - int LA12_8 = input.LA(2); - - if ((LA12_8 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 8, input); - - throw nvae; - - } - } - break; - case 26: { - int LA12_9 = input.LA(2); - - if ((LA12_9 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 9, input); - - throw nvae; - - } - } - break; - case 46: { - int LA12_10 = input.LA(2); - - if ((LA12_10 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 10, input); - - throw nvae; - - } - } - break; - case 38: { - int LA12_11 = input.LA(2); - - if ((LA12_11 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_27 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 27, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - case 22: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - case 34: - case 35: - case 36: - case 38: - case 39: - case 40: - case 43: - case 44: - case 45: - case 46: { - alt12 = 6; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 23, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 11, input); - - throw nvae; - - } - } - break; - case 39: { - int LA12_12 = input.LA(2); - - if ((LA12_12 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 12, input); - - throw nvae; - - } - } - break; - case 35: { - int LA12_13 = input.LA(2); - - if ((LA12_13 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 13, input); - - throw nvae; - - } - } - break; - case 22: { - int LA12_14 = input.LA(2); - - if ((LA12_14 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 14, input); - - throw nvae; - - } - } - break; - case 28: { - int LA12_15 = input.LA(2); - - if ((LA12_15 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 15, input); - - throw nvae; - - } - } - break; - case 43: { - int LA12_16 = input.LA(2); - - if ((LA12_16 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 16, input); - - throw nvae; - - } - } - break; - case 29: { - int LA12_17 = input.LA(2); - - if ((LA12_17 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 17, input); - - throw nvae; - - } - } - break; - case 24: { - int LA12_18 = input.LA(2); - - if ((LA12_18 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 18, input); - - throw nvae; - - } - } - break; - case 44: { - int LA12_19 = input.LA(2); - - if ((LA12_19 == LBRACKET)) { - switch (input.LA(3)) { - case RBRACKET: { - int LA12_24 = input.LA(4); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 2; - } else if ((true)) { - alt12 = 4; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 24, input); - - throw nvae; - - } - } - break; - case LCLETTER: { - int LA12_25 = input.LA(4); - - if ((LA12_25 == LCLETTER)) { - int LA12_31 = input.LA(5); - - if ((LA12_31 == RBRACKET)) { - int LA12_32 = input.LA(6); - - if (((((input.LT(1).getText().equals("W"))) || ((input - .LT(1).getText().equals("B")))))) { - alt12 = 3; - } else if ((true)) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 32, input); - - throw nvae; - - } - } else if (((LA12_31 >= COLON && LA12_31 <= COMMA) - || LA12_31 == DIGIT || LA12_31 == LCLETTER - || LA12_31 == MINUS - || (LA12_31 >= PERIOD && LA12_31 <= PLUS) || (LA12_31 >= SLASH && LA12_31 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 31, input); - - throw nvae; - - } - } else if (((LA12_25 >= COLON && LA12_25 <= COMMA) - || LA12_25 == DIGIT || LA12_25 == MINUS - || (LA12_25 >= PERIOD && LA12_25 <= RBRACKET) || (LA12_25 >= SLASH && LA12_25 <= UCLETTER))) { - alt12 = 5; - } else { - NoViableAltException nvae = new NoViableAltException( - "", 12, 25, input); - - throw nvae; - - } - } - break; - case COLON: - case COMMA: - case DIGIT: - case MINUS: - case PERIOD: - case PLUS: - case SLASH: - case SPACE: - case UCLETTER: { - alt12 = 5; - } - break; - default: - NoViableAltException nvae = new NoViableAltException( - "", 12, 22, input); - - throw nvae; - - } - - } else { - NoViableAltException nvae = new NoViableAltException("", - 12, 19, input); - - throw nvae; - - } - } - break; - case 33: { - alt12 = 7; - } - break; - case 21: - case 23: { - alt12 = 8; - } - break; - default: - NoViableAltException nvae = new NoViableAltException("", 12, 0, - input); - - throw nvae; - - } - - switch (alt12) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:4: ( numIdent ) ( ( - // LBRACKET numValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:4: ( numIdent ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:5: numIdent - { - pushFollow(FOLLOW_numIdent_in_property140); - numIdent5 = numIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(numIdent5); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:64: ( ( LBRACKET - // numValue RBRACKET ) )+ - int cnt5 = 0; - loop5: do { - int alt5 = 2; - int LA5_0 = input.LA(1); - - if ((LA5_0 == LBRACKET)) { - alt5 = 1; - } - - switch (alt5) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:65: ( - // LBRACKET numValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:65: ( - // LBRACKET numValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:66: - // LBRACKET numValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property146); - - pushFollow(FOLLOW_numValue_in_property148); - numValue6 = numValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property150); - - } - - sgfProperty - .addValue((numValue6 != null ? numValue6.sgfValue - : null)); - - } - break; - - default: - if (cnt5 >= 1) - break loop5; - EarlyExitException eee = new EarlyExitException(5, - input); - throw eee; - } - cnt5++; - } while (true); - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:4: ( playerIdent ) ( - // ( LBRACKET RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:4: ( playerIdent - // ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:5: playerIdent - { - pushFollow(FOLLOW_playerIdent_in_property164); - playerIdent7 = playerIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(playerIdent7); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:71: ( ( LBRACKET - // RBRACKET ) )+ - int cnt6 = 0; - loop6: do { - int alt6 = 2; - int LA6_0 = input.LA(1); - - if ((LA6_0 == LBRACKET)) { - alt6 = 1; - } - - switch (alt6) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:72: ( - // LBRACKET RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:72: ( - // LBRACKET RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:73: - // LBRACKET RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property170); - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property172); - - } - - sgfProperty.addValue(SGFValue.EMPTY); - - } - break; - - default: - if (cnt6 >= 1) - break loop6; - EarlyExitException eee = new EarlyExitException(6, - input); - throw eee; - } - cnt6++; - } while (true); - - } - break; - case 3: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:4: ( playerIdent ) ( - // ( LBRACKET coordValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:4: ( playerIdent - // ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:5: playerIdent - { - pushFollow(FOLLOW_playerIdent_in_property182); - playerIdent8 = playerIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(playerIdent8); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:71: ( ( LBRACKET - // coordValue RBRACKET ) )+ - int cnt7 = 0; - loop7: do { - int alt7 = 2; - int LA7_0 = input.LA(1); - - if ((LA7_0 == LBRACKET)) { - alt7 = 1; - } - - switch (alt7) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:72: ( - // LBRACKET coordValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:72: ( - // LBRACKET coordValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:73: - // LBRACKET coordValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property188); - - pushFollow(FOLLOW_coordValue_in_property190); - coordValue9 = coordValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property192); - - } - - sgfProperty.addValue(new SGFValue( - (coordValue9 != null ? coordValue9.sgfCoord - : null))); - - } - break; - - default: - if (cnt7 >= 1) - break loop7; - EarlyExitException eee = new EarlyExitException(7, - input); - throw eee; - } - cnt7++; - } while (true); - - } - break; - case 4: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:4: ( strIdent ) ( ( - // LBRACKET RBRACKET ) ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:4: ( strIdent ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:5: strIdent - { - pushFollow(FOLLOW_strIdent_in_property206); - strIdent10 = strIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(strIdent10); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:64: ( ( LBRACKET - // RBRACKET ) ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:65: ( LBRACKET - // RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:65: ( - // LBRACKET RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:66: LBRACKET - // RBRACKET - { - match(input, LBRACKET, FOLLOW_LBRACKET_in_property212); - - match(input, RBRACKET, FOLLOW_RBRACKET_in_property214); - - } - - sgfProperty.addValue(SGFValue.EMPTY); - - } - - } - break; - case 5: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:4: ( strIdent ) ( ( - // LBRACKET strValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:4: ( strIdent ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:5: strIdent - { - pushFollow(FOLLOW_strIdent_in_property223); - strIdent11 = strIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(strIdent11); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:64: ( ( LBRACKET - // strValue RBRACKET ) )+ - int cnt8 = 0; - loop8: do { - int alt8 = 2; - int LA8_0 = input.LA(1); - - if ((LA8_0 == LBRACKET)) { - alt8 = 1; - } - - switch (alt8) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:65: ( - // LBRACKET strValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:65: ( - // LBRACKET strValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:66: - // LBRACKET strValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property229); - - pushFollow(FOLLOW_strValue_in_property231); - strValue12 = strValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property233); - - } - - sgfProperty.addValue(new SGFValue( - (strValue12 != null ? input.toString( - strValue12.start, strValue12.stop) - : null))); - - } - break; - - default: - if (cnt8 >= 1) - break loop8; - EarlyExitException eee = new EarlyExitException(8, - input); - throw eee; - } - cnt8++; - } while (true); - - } - break; - case 6: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:4: ( result ) ( ( - // LBRACKET resValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:4: ( result ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:5: result - { - pushFollow(FOLLOW_result_in_property245); - result(); - - state._fsp--; - - sgfProperty.setIdentifier(SGFIdentifier.RESULT); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:64: ( ( LBRACKET - // resValue RBRACKET ) )+ - int cnt9 = 0; - loop9: do { - int alt9 = 2; - int LA9_0 = input.LA(1); - - if ((LA9_0 == LBRACKET)) { - alt9 = 1; - } - - switch (alt9) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:65: ( - // LBRACKET resValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:65: ( - // LBRACKET resValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:66: - // LBRACKET resValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property251); - - pushFollow(FOLLOW_resValue_in_property253); - resValue13 = resValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property255); - - } - - sgfProperty.addValue(new SGFValue( - new SGFResult((resValue13 != null ? input - .toString(resValue13.start, - resValue13.stop) : null)))); - - } - break; - - default: - if (cnt9 >= 1) - break loop9; - EarlyExitException eee = new EarlyExitException(9, - input); - throw eee; - } - cnt9++; - } while (true); - - } - break; - case 7: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:4: ( komi ) ( ( - // LBRACKET realValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:4: ( komi ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:5: komi - { - pushFollow(FOLLOW_komi_in_property265); - komi(); - - state._fsp--; - - sgfProperty.setIdentifier(SGFIdentifier.KOMI); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:60: ( ( LBRACKET - // realValue RBRACKET ) )+ - int cnt10 = 0; - loop10: do { - int alt10 = 2; - int LA10_0 = input.LA(1); - - if ((LA10_0 == LBRACKET)) { - alt10 = 1; - } - - switch (alt10) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:61: ( - // LBRACKET realValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:61: ( - // LBRACKET realValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:48:62: - // LBRACKET realValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property271); - - pushFollow(FOLLOW_realValue_in_property273); - realValue14 = realValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property275); - - } - - sgfProperty.addValue(new SGFValue(Double - .parseDouble((realValue14 != null ? input - .toString(realValue14.start, - realValue14.stop) : null)))); - - } - break; - - default: - if (cnt10 >= 1) - break loop10; - EarlyExitException eee = new EarlyExitException(10, - input); - throw eee; - } - cnt10++; - } while (true); - - } - break; - case 8: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:4: ( coordIdent ) ( - // ( LBRACKET coordValue RBRACKET ) )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:4: ( coordIdent - // ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:5: coordIdent - { - pushFollow(FOLLOW_coordIdent_in_property285); - coordIdent15 = coordIdent(); - - state._fsp--; - - sgfProperty.setIdentifier(coordIdent15); - - } - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:67: ( ( LBRACKET - // coordValue RBRACKET ) )+ - int cnt11 = 0; - loop11: do { - int alt11 = 2; - int LA11_0 = input.LA(1); - - if ((LA11_0 == LBRACKET)) { - alt11 = 1; - } - - switch (alt11) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:68: ( - // LBRACKET coordValue RBRACKET ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:68: ( - // LBRACKET coordValue RBRACKET ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:69: - // LBRACKET coordValue RBRACKET - { - match(input, LBRACKET, - FOLLOW_LBRACKET_in_property290); - - pushFollow(FOLLOW_coordValue_in_property292); - coordValue16 = coordValue(); - - state._fsp--; - - match(input, RBRACKET, - FOLLOW_RBRACKET_in_property294); - - } - - sgfProperty.addValue(new SGFValue( - new SGFCoord((coordValue16 != null ? input - .toString(coordValue16.start, - coordValue16.stop) : null)))); - - } - break; - - default: - if (cnt11 >= 1) - break loop11; - EarlyExitException eee = new EarlyExitException(11, - input); - throw eee; - } - cnt11++; - } while (true); - - } - break; - - } - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfProperty; - } - - // $ANTLR end "property" - - // $ANTLR start "playerIdent" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:53:1: playerIdent returns - // [SGFIdentifier sgfPlayer] : ({...}? strIdent |{...}? strIdent ); - public final SGFIdentifier playerIdent() throws RecognitionException { - SGFIdentifier sgfPlayer = null; - - SGFIdentifier strIdent17 = null; - - SGFIdentifier strIdent18 = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:54:2: ({...}? strIdent - // |{...}? strIdent ) - int alt13 = 2; - switch (input.LA(1)) { - case 27: { - int LA13_1 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 1, input); - - throw nvae; - - } - } - break; - case 40: { - int LA13_2 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 2, input); - - throw nvae; - - } - } - break; - case 25: { - int LA13_3 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 3, input); - - throw nvae; - - } - } - break; - case 45: { - int LA13_4 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 4, input); - - throw nvae; - - } - } - break; - case 30: { - int LA13_5 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 5, input); - - throw nvae; - - } - } - break; - case 34: { - int LA13_6 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 6, input); - - throw nvae; - - } - } - break; - case 36: { - int LA13_7 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 7, input); - - throw nvae; - - } - } - break; - case 26: { - int LA13_8 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 8, input); - - throw nvae; - - } - } - break; - case 46: { - int LA13_9 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 9, input); - - throw nvae; - - } - } - break; - case 38: { - int LA13_10 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 10, input); - - throw nvae; - - } - } - break; - case 39: { - int LA13_11 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 11, input); - - throw nvae; - - } - } - break; - case 35: { - int LA13_12 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 12, input); - - throw nvae; - - } - } - break; - case 22: { - int LA13_13 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 13, input); - - throw nvae; - - } - } - break; - case 28: { - int LA13_14 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 14, input); - - throw nvae; - - } - } - break; - case 43: { - int LA13_15 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 15, input); - - throw nvae; - - } - } - break; - case 29: { - int LA13_16 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 16, input); - - throw nvae; - - } - } - break; - case 24: { - int LA13_17 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 17, input); - - throw nvae; - - } - } - break; - case 44: { - int LA13_18 = input.LA(2); - - if ((((input.LT(1).getText().equals("W"))))) { - alt13 = 1; - } else if ((((input.LT(1).getText().equals("B"))))) { - alt13 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 13, 18, input); - - throw nvae; - - } - } - break; - default: - NoViableAltException nvae = new NoViableAltException("", 13, 0, - input); - - throw nvae; - - } - - switch (alt13) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:54:4: {...}? strIdent - { - if (!(((input.LT(1).getText().equals("W"))))) { - throw new FailedPredicateException(input, "playerIdent", - "(input.LT(1).getText().equals(\"W\"))"); - } - - pushFollow(FOLLOW_strIdent_in_playerIdent317); - strIdent17 = strIdent(); - - state._fsp--; - - sgfPlayer = strIdent17; - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:55:4: {...}? strIdent - { - if (!(((input.LT(1).getText().equals("B"))))) { - throw new FailedPredicateException(input, "playerIdent", - "(input.LT(1).getText().equals(\"B\"))"); - } - - pushFollow(FOLLOW_strIdent_in_playerIdent326); - strIdent18 = strIdent(); - - state._fsp--; - - sgfPlayer = strIdent18; - - } - break; - - } - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfPlayer; - } - - // $ANTLR end "playerIdent" - - // $ANTLR start "strIdent" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:58:1: strIdent returns - // [SGFIdentifier sgfIdent] : ( charEnc | source | blackCountry | - // whiteCountry | event | playerBlack | playerWhite | blackRank | whiteRank - // | result | rules | place | application | copyright | username | date | - // 'B' | 'W' ); - public final SGFIdentifier strIdent() throws RecognitionException { - SGFIdentifier sgfIdent = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:59:2: ( charEnc | - // source | blackCountry | whiteCountry | event | playerBlack | - // playerWhite | blackRank | whiteRank | result | rules | place | - // application | copyright | username | date | 'B' | 'W' ) - int alt14 = 18; - switch (input.LA(1)) { - case 27: { - alt14 = 1; - } - break; - case 40: { - alt14 = 2; - } - break; - case 25: { - alt14 = 3; - } - break; - case 45: { - alt14 = 4; - } - break; - case 30: { - alt14 = 5; - } - break; - case 34: { - alt14 = 6; - } - break; - case 36: { - alt14 = 7; - } - break; - case 26: { - alt14 = 8; - } - break; - case 46: { - alt14 = 9; - } - break; - case 38: { - alt14 = 10; - } - break; - case 39: { - alt14 = 11; - } - break; - case 35: { - alt14 = 12; - } - break; - case 22: { - alt14 = 13; - } - break; - case 28: { - alt14 = 14; - } - break; - case 43: { - alt14 = 15; - } - break; - case 29: { - alt14 = 16; - } - break; - case 24: { - alt14 = 17; - } - break; - case 44: { - alt14 = 18; - } - break; - default: - NoViableAltException nvae = new NoViableAltException("", 14, 0, - input); - - throw nvae; - - } - - switch (alt14) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:59:4: charEnc - { - pushFollow(FOLLOW_charEnc_in_strIdent343); - charEnc(); - - state._fsp--; - - sgfIdent = SGFIdentifier.CHARSET; - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:60:10: source - { - pushFollow(FOLLOW_source_in_strIdent355); - source(); - - state._fsp--; - - } - break; - case 3: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:61:10: blackCountry - { - pushFollow(FOLLOW_blackCountry_in_strIdent366); - blackCountry(); - - state._fsp--; - - } - break; - case 4: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:62:10: whiteCountry - { - pushFollow(FOLLOW_whiteCountry_in_strIdent377); - whiteCountry(); - - state._fsp--; - - } - break; - case 5: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:63:4: event - { - pushFollow(FOLLOW_event_in_strIdent382); - event(); - - state._fsp--; - - } - break; - case 6: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:64:4: playerBlack - { - pushFollow(FOLLOW_playerBlack_in_strIdent387); - playerBlack(); - - state._fsp--; - - } - break; - case 7: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:65:4: playerWhite - { - pushFollow(FOLLOW_playerWhite_in_strIdent392); - playerWhite(); - - state._fsp--; - - } - break; - case 8: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:66:4: blackRank - { - pushFollow(FOLLOW_blackRank_in_strIdent397); - blackRank(); - - state._fsp--; - - } - break; - case 9: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:67:4: whiteRank - { - pushFollow(FOLLOW_whiteRank_in_strIdent402); - whiteRank(); - - state._fsp--; - - } - break; - case 10: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:68:4: result - { - pushFollow(FOLLOW_result_in_strIdent407); - result(); - - state._fsp--; - - } - break; - case 11: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:69:4: rules - { - pushFollow(FOLLOW_rules_in_strIdent412); - rules(); - - state._fsp--; - - } - break; - case 12: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:70:4: place - { - pushFollow(FOLLOW_place_in_strIdent417); - place(); - - state._fsp--; - - } - break; - case 13: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:71:12: application - { - pushFollow(FOLLOW_application_in_strIdent430); - application(); - - state._fsp--; - - } - break; - case 14: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:72:11: copyright - { - pushFollow(FOLLOW_copyright_in_strIdent442); - copyright(); - - state._fsp--; - - } - break; - case 15: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:73:11: username - { - pushFollow(FOLLOW_username_in_strIdent454); - username(); - - state._fsp--; - - } - break; - case 16: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:74:11: date - { - pushFollow(FOLLOW_date_in_strIdent466); - date(); - - state._fsp--; - - } - break; - case 17: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:75:11: 'B' - { - match(input, 24, FOLLOW_24_in_strIdent478); - - sgfIdent = SGFIdentifier.MOVE_BLACK; - - } - break; - case 18: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:76:11: 'W' - { - match(input, 44, FOLLOW_44_in_strIdent491); - - sgfIdent = SGFIdentifier.MOVE_WHITE; - - } - break; - - } - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfIdent; - } - - // $ANTLR end "strIdent" - - // $ANTLR start "coordIdent" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:81:1: coordIdent returns - // [SGFIdentifier sgfIdent] : ( addBlack | addWhite ); - public final SGFIdentifier coordIdent() throws RecognitionException { - SGFIdentifier sgfIdent = null; - - SGFIdentifier addBlack19 = null; - - SGFIdentifier addWhite20 = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:82:2: ( addBlack | - // addWhite ) - int alt15 = 2; - int LA15_0 = input.LA(1); - - if ((LA15_0 == 21)) { - alt15 = 1; - } else if ((LA15_0 == 23)) { - alt15 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", 15, 0, - input); - - throw nvae; - - } - switch (alt15) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:82:4: addBlack - { - pushFollow(FOLLOW_addBlack_in_coordIdent537); - addBlack19 = addBlack(); - - state._fsp--; - - sgfIdent = addBlack19; - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:83:5: addWhite - { - pushFollow(FOLLOW_addWhite_in_coordIdent545); - addWhite20 = addWhite(); - - state._fsp--; - - sgfIdent = addWhite20; - - } - break; - - } - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfIdent; - } - - // $ANTLR end "coordIdent" - - // $ANTLR start "numIdent" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:86:1: numIdent returns - // [SGFIdentifier sgfIdent] : ( fileFormat | game | size | time ); - public final SGFIdentifier numIdent() throws RecognitionException { - SGFIdentifier sgfIdent = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:87:2: ( fileFormat | - // game | size | time ) - int alt16 = 4; - switch (input.LA(1)) { - case 31: { - alt16 = 1; - } - break; - case 32: { - alt16 = 2; - } - break; - case 41: { - alt16 = 3; - } - break; - case 42: { - alt16 = 4; - } - break; - default: - NoViableAltException nvae = new NoViableAltException("", 16, 0, - input); - - throw nvae; - - } - - switch (alt16) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:87:4: fileFormat - { - pushFollow(FOLLOW_fileFormat_in_numIdent562); - fileFormat(); - - state._fsp--; - - sgfIdent = SGFIdentifier.FILE_FORMAT; - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:88:4: game - { - pushFollow(FOLLOW_game_in_numIdent568); - game(); - - state._fsp--; - - sgfIdent = SGFIdentifier.GAME; - - } - break; - case 3: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:89:4: size - { - pushFollow(FOLLOW_size_in_numIdent574); - size(); - - state._fsp--; - - sgfIdent = SGFIdentifier.SIZE; - - } - break; - case 4: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:90:4: time - { - pushFollow(FOLLOW_time_in_numIdent580); - time(); - - state._fsp--; - - sgfIdent = SGFIdentifier.TIME; - - } - break; - - } - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfIdent; - } - - // $ANTLR end "numIdent" - - public static class numValue_return extends ParserRuleReturnScope { - public SGFValue sgfValue; - }; - - // $ANTLR start "numValue" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:92:1: numValue returns - // [SGFValue sgfValue] : ( ( DIGIT )+ ) ; - public final SGFParser.numValue_return numValue() - throws RecognitionException { - SGFParser.numValue_return retval = new SGFParser.numValue_return(); - retval.start = input.LT(1); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:2: ( ( ( DIGIT )+ ) - // ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:4: ( ( DIGIT )+ ) - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:4: ( ( DIGIT )+ - // ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:5: ( DIGIT )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:5: ( DIGIT - // )+ - int cnt17 = 0; - loop17: do { - int alt17 = 2; - int LA17_0 = input.LA(1); - - if ((LA17_0 == DIGIT)) { - alt17 = 1; - } - - switch (alt17) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:5: DIGIT - { - match(input, DIGIT, FOLLOW_DIGIT_in_numValue595); - - } - break; - - default: - if (cnt17 >= 1) - break loop17; - EarlyExitException eee = new EarlyExitException(17, - input); - throw eee; - } - cnt17++; - } while (true); - - } - - retval.sgfValue = new SGFValue(Integer.parseInt(input - .toString(retval.start, input.LT(-1)))); - - } - - retval.stop = input.LT(-1); - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return retval; - } - - // $ANTLR end "numValue" - - // $ANTLR start "realIdent" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:95:1: realIdent : komi ; - public final void realIdent() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:96:2: ( komi ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:96:4: komi - { - pushFollow(FOLLOW_komi_in_realIdent608); - komi(); - - state._fsp--; - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "realIdent" - - public static class resValue_return extends ParserRuleReturnScope { - }; - - // $ANTLR start "resValue" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:98:1: resValue : playerIdent - // PLUS ( 'R' | realValue ) ; - public final SGFParser.resValue_return resValue() - throws RecognitionException { - SGFParser.resValue_return retval = new SGFParser.resValue_return(); - retval.start = input.LT(1); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:2: ( playerIdent - // PLUS ( 'R' | realValue ) ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:4: playerIdent PLUS - // ( 'R' | realValue ) - { - pushFollow(FOLLOW_playerIdent_in_resValue618); - playerIdent(); - - state._fsp--; - - match(input, PLUS, FOLLOW_PLUS_in_resValue620); - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:21: ( 'R' | - // realValue ) - int alt18 = 2; - int LA18_0 = input.LA(1); - - if ((LA18_0 == 37)) { - alt18 = 1; - } else if ((LA18_0 == DIGIT)) { - alt18 = 2; - } else { - NoViableAltException nvae = new NoViableAltException("", - 18, 0, input); - - throw nvae; - - } - switch (alt18) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:22: 'R' - { - match(input, 37, FOLLOW_37_in_resValue623); - - } - break; - case 2: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:28: realValue - { - pushFollow(FOLLOW_realValue_in_resValue627); - realValue(); - - state._fsp--; - - } - break; - - } - - } - - retval.stop = input.LT(-1); - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return retval; - } - - // $ANTLR end "resValue" - - public static class realValue_return extends ParserRuleReturnScope { - }; - - // $ANTLR start "realValue" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:101:1: realValue : ( DIGIT )+ - // PERIOD ( DIGIT )+ ; - public final SGFParser.realValue_return realValue() - throws RecognitionException { - SGFParser.realValue_return retval = new SGFParser.realValue_return(); - retval.start = input.LT(1); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:2: ( ( DIGIT )+ - // PERIOD ( DIGIT )+ ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:4: ( DIGIT )+ - // PERIOD ( DIGIT )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:4: ( DIGIT )+ - int cnt19 = 0; - loop19: do { - int alt19 = 2; - int LA19_0 = input.LA(1); - - if ((LA19_0 == DIGIT)) { - alt19 = 1; - } - - switch (alt19) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:4: DIGIT - { - match(input, DIGIT, FOLLOW_DIGIT_in_realValue638); - - } - break; - - default: - if (cnt19 >= 1) - break loop19; - EarlyExitException eee = new EarlyExitException(19, - input); - throw eee; - } - cnt19++; - } while (true); - - match(input, PERIOD, FOLLOW_PERIOD_in_realValue641); - - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:18: ( DIGIT )+ - int cnt20 = 0; - loop20: do { - int alt20 = 2; - int LA20_0 = input.LA(1); - - if ((LA20_0 == DIGIT)) { - alt20 = 1; - } - - switch (alt20) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:18: DIGIT - { - match(input, DIGIT, FOLLOW_DIGIT_in_realValue643); - - } - break; - - default: - if (cnt20 >= 1) - break loop20; - EarlyExitException eee = new EarlyExitException(20, - input); - throw eee; - } - cnt20++; - } while (true); - - } - - retval.stop = input.LT(-1); - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return retval; - } - - // $ANTLR end "realValue" - - public static class coordValue_return extends ParserRuleReturnScope { - public SGFCoord sgfCoord; - }; - - // $ANTLR start "coordValue" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:104:1: coordValue returns - // [SGFCoord sgfCoord] : LCLETTER LCLETTER ; - public final SGFParser.coordValue_return coordValue() - throws RecognitionException { - SGFParser.coordValue_return retval = new SGFParser.coordValue_return(); - retval.start = input.LT(1); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:105:2: ( LCLETTER - // LCLETTER ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:105:4: LCLETTER - // LCLETTER - { - match(input, LCLETTER, FOLLOW_LCLETTER_in_coordValue658); - - match(input, LCLETTER, FOLLOW_LCLETTER_in_coordValue660); - - retval.sgfCoord = new SGFCoord(input.toString(retval.start, - input.LT(-1))); - - } - - retval.stop = input.LT(-1); - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return retval; - } - - // $ANTLR end "coordValue" - - // $ANTLR start "fileFormat" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:108:1: fileFormat : 'FF' ; - public final void fileFormat() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:109:2: ( 'FF' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:109:4: 'FF' - { - match(input, 31, FOLLOW_31_in_fileFormat674); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "fileFormat" - - // $ANTLR start "game" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:110:1: game : 'GM' ; - public final void game() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:110:7: ( 'GM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:110:9: 'GM' - { - match(input, 32, FOLLOW_32_in_game682); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "game" - - // $ANTLR start "size" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:111:1: size : 'SZ' ; - public final void size() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:111:7: ( 'SZ' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:111:9: 'SZ' - { - match(input, 41, FOLLOW_41_in_size690); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "size" - - // $ANTLR start "charEnc" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:112:1: charEnc : 'CA' ; - public final void charEnc() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:112:9: ( 'CA' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:112:11: 'CA' - { - match(input, 27, FOLLOW_27_in_charEnc697); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "charEnc" - - // $ANTLR start "source" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:113:1: source : 'SO' ; - public final void source() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:113:8: ( 'SO' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:113:10: 'SO' - { - match(input, 40, FOLLOW_40_in_source704); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "source" - - // $ANTLR start "blackCountry" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:114:1: blackCountry : 'BC' ; - public final void blackCountry() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:115:2: ( 'BC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:115:4: 'BC' - { - match(input, 25, FOLLOW_25_in_blackCountry713); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "blackCountry" - - // $ANTLR start "whiteCountry" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:116:1: whiteCountry : 'WC' ; - public final void whiteCountry() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:117:2: ( 'WC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:117:4: 'WC' - { - match(input, 45, FOLLOW_45_in_whiteCountry722); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "whiteCountry" - - // $ANTLR start "event" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:118:1: event : 'EV' ; - public final void event() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:118:7: ( 'EV' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:118:9: 'EV' - { - match(input, 30, FOLLOW_30_in_event729); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "event" - - // $ANTLR start "playerBlack" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:119:1: playerBlack : 'PB' ; - public final void playerBlack() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:120:2: ( 'PB' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:120:4: 'PB' - { - match(input, 34, FOLLOW_34_in_playerBlack737); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "playerBlack" - - // $ANTLR start "playerWhite" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:121:1: playerWhite : 'PW' ; - public final void playerWhite() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:122:2: ( 'PW' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:122:4: 'PW' - { - match(input, 36, FOLLOW_36_in_playerWhite745); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "playerWhite" - - // $ANTLR start "blackRank" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:123:1: blackRank : 'BR' ; - public final void blackRank() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:124:2: ( 'BR' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:124:4: 'BR' - { - match(input, 26, FOLLOW_26_in_blackRank753); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "blackRank" - - // $ANTLR start "whiteRank" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:125:1: whiteRank : 'WR' ; - public final void whiteRank() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:126:2: ( 'WR' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:126:5: 'WR' - { - match(input, 46, FOLLOW_46_in_whiteRank763); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "whiteRank" - - // $ANTLR start "komi" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:127:1: komi : 'KM' ; - public final void komi() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:127:7: ( 'KM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:127:9: 'KM' - { - match(input, 33, FOLLOW_33_in_komi771); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "komi" - - // $ANTLR start "result" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:128:1: result : 'RE' ; - public final void result() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:128:9: ( 'RE' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:128:11: 'RE' - { - match(input, 38, FOLLOW_38_in_result779); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "result" - - // $ANTLR start "rules" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:129:1: rules : 'RU' ; - public final void rules() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:129:7: ( 'RU' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:129:9: 'RU' - { - match(input, 39, FOLLOW_39_in_rules786); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "rules" - - // $ANTLR start "place" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:130:1: place : 'PC' ; - public final void place() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:130:8: ( 'PC' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:130:11: 'PC' - { - match(input, 35, FOLLOW_35_in_place795); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "place" - - // $ANTLR start "application" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:131:1: application : 'AP' ; - public final void application() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:132:2: ( 'AP' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:132:4: 'AP' - { - match(input, 22, FOLLOW_22_in_application803); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "application" - - // $ANTLR start "time" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:133:1: time : 'TM' ; - public final void time() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:133:6: ( 'TM' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:133:8: 'TM' - { - match(input, 42, FOLLOW_42_in_time810); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "time" - - // $ANTLR start "date" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:134:1: date : 'DT' ; - public final void date() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:134:7: ( 'DT' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:134:9: 'DT' - { - match(input, 29, FOLLOW_29_in_date818); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "date" - - // $ANTLR start "addBlack" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:136:1: addBlack returns - // [SGFIdentifier sgfIdent] : 'AB' ; - public final SGFIdentifier addBlack() throws RecognitionException { - SGFIdentifier sgfIdent = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:137:2: ( 'AB' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:137:4: 'AB' - { - match(input, 21, FOLLOW_21_in_addBlack831); - - sgfIdent = SGFIdentifier.ADD_BLACK; - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfIdent; - } - - // $ANTLR end "addBlack" - - // $ANTLR start "addWhite" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:140:1: addWhite returns - // [SGFIdentifier sgfIdent] : 'AW' ; - public final SGFIdentifier addWhite() throws RecognitionException { - SGFIdentifier sgfIdent = null; - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:141:2: ( 'AW' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:141:4: 'AW' - { - match(input, 23, FOLLOW_23_in_addWhite848); - - sgfIdent = SGFIdentifier.ADD_WHITE; - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return sgfIdent; - } - - // $ANTLR end "addWhite" - - // $ANTLR start "copyright" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:144:1: copyright : 'CP' ; - public final void copyright() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:145:2: ( 'CP' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:145:4: 'CP' - { - match(input, 28, FOLLOW_28_in_copyright860); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "copyright" - - // $ANTLR start "username" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:146:1: username : 'US' ; - public final void username() throws RecognitionException { - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:146:9: ( 'US' ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:146:11: 'US' - { - match(input, 43, FOLLOW_43_in_username866); - - } - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return; - } - - // $ANTLR end "username" - - public static class strValue_return extends ParserRuleReturnScope { - }; - - // $ANTLR start "strValue" - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:1: strValue : ( UCLETTER | - // LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH | COLON - // )+ ; - public final SGFParser.strValue_return strValue() - throws RecognitionException { - SGFParser.strValue_return retval = new SGFParser.strValue_return(); - retval.start = input.LT(1); - - try { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:10: ( ( UCLETTER | - // LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH - // | COLON )+ ) - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:12: ( UCLETTER | - // LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | SLASH - // | COLON )+ - { - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:12: ( UCLETTER - // | LCLETTER | MINUS | DIGIT | SPACE | PERIOD | COMMA | PLUS | - // SLASH | COLON )+ - int cnt21 = 0; - loop21: do { - int alt21 = 2; - int LA21_0 = input.LA(1); - - if (((LA21_0 >= COLON && LA21_0 <= COMMA) - || LA21_0 == DIGIT || LA21_0 == LCLETTER - || LA21_0 == MINUS - || (LA21_0 >= PERIOD && LA21_0 <= PLUS) || (LA21_0 >= SLASH && LA21_0 <= UCLETTER))) { - alt21 = 1; - } - - switch (alt21) { - case 1: - // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: - { - if ((input.LA(1) >= COLON && input.LA(1) <= COMMA) - || input.LA(1) == DIGIT - || input.LA(1) == LCLETTER - || input.LA(1) == MINUS - || (input.LA(1) >= PERIOD && input.LA(1) <= PLUS) - || (input.LA(1) >= SLASH && input.LA(1) <= UCLETTER)) { - input.consume(); - state.errorRecovery = false; - } else { - MismatchedSetException mse = new MismatchedSetException( - null, input); - throw mse; - } - - } - break; - - default: - if (cnt21 >= 1) - break loop21; - EarlyExitException eee = new EarlyExitException(21, - input); - throw eee; - } - cnt21++; - } while (true); - - } - - retval.stop = input.LT(-1); - - } catch (RecognitionException re) { - reportError(re); - recover(input, re); - } - - finally { - // do for sure before leaving - } - return retval; - } - - // $ANTLR end "strValue" - - // Delegated rules - - public static final BitSet FOLLOW_gameTree_in_collection36 = new BitSet( - new long[] { 0x0000000000000402L }); - public static final BitSet FOLLOW_LPAREN_in_gameTree61 = new BitSet( - new long[] { 0x0000000000020000L }); - public static final BitSet FOLLOW_sequence_in_gameTree63 = new BitSet( - new long[] { 0x0000000000010400L }); - public static final BitSet FOLLOW_gameTree_in_gameTree67 = new BitSet( - new long[] { 0x0000000000010400L }); - public static final BitSet FOLLOW_RPAREN_in_gameTree72 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_node_in_sequence94 = new BitSet( - new long[] { 0x0000000000020002L }); - public static final BitSet FOLLOW_SEMICOLON_in_node115 = new BitSet( - new long[] { 0x00007FDFFFE00002L }); - public static final BitSet FOLLOW_property_in_node118 = new BitSet( - new long[] { 0x00007FDFFFE00002L }); - public static final BitSet FOLLOW_numIdent_in_property140 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property146 = new BitSet( - new long[] { 0x0000000000000080L }); - public static final BitSet FOLLOW_numValue_in_property148 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property150 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_playerIdent_in_property164 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property170 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property172 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_playerIdent_in_property182 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property188 = new BitSet( - new long[] { 0x0000000000000200L }); - public static final BitSet FOLLOW_coordValue_in_property190 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property192 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_strIdent_in_property206 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property212 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property214 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_strIdent_in_property223 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property229 = new BitSet( - new long[] { 0x00000000001C6AB0L }); - public static final BitSet FOLLOW_strValue_in_property231 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property233 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_result_in_property245 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property251 = new BitSet( - new long[] { 0x000079DC7F400000L }); - public static final BitSet FOLLOW_resValue_in_property253 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property255 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_komi_in_property265 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property271 = new BitSet( - new long[] { 0x0000000000000080L }); - public static final BitSet FOLLOW_realValue_in_property273 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property275 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_coordIdent_in_property285 = new BitSet( - new long[] { 0x0000000000000100L }); - public static final BitSet FOLLOW_LBRACKET_in_property290 = new BitSet( - new long[] { 0x0000000000000200L }); - public static final BitSet FOLLOW_coordValue_in_property292 = new BitSet( - new long[] { 0x0000000000008000L }); - public static final BitSet FOLLOW_RBRACKET_in_property294 = new BitSet( - new long[] { 0x0000000000000102L }); - public static final BitSet FOLLOW_strIdent_in_playerIdent317 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_strIdent_in_playerIdent326 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_charEnc_in_strIdent343 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_source_in_strIdent355 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_blackCountry_in_strIdent366 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_whiteCountry_in_strIdent377 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_event_in_strIdent382 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_playerBlack_in_strIdent387 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_playerWhite_in_strIdent392 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_blackRank_in_strIdent397 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_whiteRank_in_strIdent402 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_result_in_strIdent407 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_rules_in_strIdent412 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_place_in_strIdent417 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_application_in_strIdent430 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_copyright_in_strIdent442 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_username_in_strIdent454 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_date_in_strIdent466 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_24_in_strIdent478 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_44_in_strIdent491 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_addBlack_in_coordIdent537 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_addWhite_in_coordIdent545 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_fileFormat_in_numIdent562 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_game_in_numIdent568 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_size_in_numIdent574 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_time_in_numIdent580 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_DIGIT_in_numValue595 = new BitSet( - new long[] { 0x0000000000000082L }); - public static final BitSet FOLLOW_komi_in_realIdent608 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_playerIdent_in_resValue618 = new BitSet( - new long[] { 0x0000000000004000L }); - public static final BitSet FOLLOW_PLUS_in_resValue620 = new BitSet( - new long[] { 0x0000002000000080L }); - public static final BitSet FOLLOW_37_in_resValue623 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_realValue_in_resValue627 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_DIGIT_in_realValue638 = new BitSet( - new long[] { 0x0000000000002080L }); - public static final BitSet FOLLOW_PERIOD_in_realValue641 = new BitSet( - new long[] { 0x0000000000000080L }); - public static final BitSet FOLLOW_DIGIT_in_realValue643 = new BitSet( - new long[] { 0x0000000000000082L }); - public static final BitSet FOLLOW_LCLETTER_in_coordValue658 = new BitSet( - new long[] { 0x0000000000000200L }); - public static final BitSet FOLLOW_LCLETTER_in_coordValue660 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_31_in_fileFormat674 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_32_in_game682 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_41_in_size690 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_27_in_charEnc697 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_40_in_source704 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_25_in_blackCountry713 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_45_in_whiteCountry722 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_30_in_event729 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_34_in_playerBlack737 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_36_in_playerWhite745 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_26_in_blackRank753 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_46_in_whiteRank763 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_33_in_komi771 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_38_in_result779 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_39_in_rules786 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_35_in_place795 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_22_in_application803 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_42_in_time810 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_29_in_date818 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_21_in_addBlack831 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_23_in_addWhite848 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_28_in_copyright860 = new BitSet( - new long[] { 0x0000000000000002L }); - public static final BitSet FOLLOW_43_in_username866 = new BitSet( - new long[] { 0x0000000000000002L }); + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfNodeCollection; + } + // $ANTLR end "collection" + + + + // $ANTLR start "gameTree" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:14:1: gameTree returns [SGFGameTree sgfGameTree] : LPAREN sequence ( gameTree )* RPAREN ; + public final SGFGameTree gameTree() throws RecognitionException { + SGFGameTree sgfGameTree = null; + + + List sequence2 =null; + + + + sgfGameTree = new SGFGameTree(); + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:2: ( LPAREN sequence ( gameTree )* RPAREN ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:5: LPAREN sequence ( gameTree )* RPAREN + { + match(input,LPAREN,FOLLOW_LPAREN_in_gameTree61); + + pushFollow(FOLLOW_sequence_in_gameTree63); + sequence2=sequence(); + + state._fsp--; + + + sgfGameTree.setNodeSequence(sequence2); + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:76: ( gameTree )* + loop2: + do { + int alt2=2; + int LA2_0 = input.LA(1); + + if ( (LA2_0==LPAREN) ) { + alt2=1; + } + + + switch (alt2) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:18:77: gameTree + { + pushFollow(FOLLOW_gameTree_in_gameTree67); + gameTree(); + + state._fsp--; + + + sgfGameTree.addSubTree(sgfGameTree); + + } + break; + + default : + break loop2; + } + } while (true); + + + match(input,RPAREN,FOLLOW_RPAREN_in_gameTree72); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfGameTree; + } + // $ANTLR end "gameTree" + + + + // $ANTLR start "sequence" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:21:1: sequence returns [List nodeSequence] : ( node )+ ; + public final List sequence() throws RecognitionException { + List nodeSequence = null; + + + SGFNode node3 =null; + + + + nodeSequence = new ArrayList(); + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:2: ( ( node )+ ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:4: ( node )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:4: ( node )+ + int cnt3=0; + loop3: + do { + int alt3=2; + int LA3_0 = input.LA(1); + + if ( (LA3_0==SEMICOLON) ) { + alt3=1; + } + + + switch (alt3) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:25:5: node + { + pushFollow(FOLLOW_node_in_sequence94); + node3=node(); + + state._fsp--; + + + nodeSequence.add(node3); + + } + break; + + default : + if ( cnt3 >= 1 ) break loop3; + EarlyExitException eee = + new EarlyExitException(3, input); + throw eee; + } + cnt3++; + } while (true); + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return nodeSequence; + } + // $ANTLR end "sequence" + + + + // $ANTLR start "node" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:27:1: node returns [SGFNode sgfNode] : SEMICOLON ( property )* ; + public final SGFNode node() throws RecognitionException { + SGFNode sgfNode = null; + + + SGFProperty property4 =null; + + + + sgfNode = new SGFNode(); + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:2: ( SEMICOLON ( property )* ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:4: SEMICOLON ( property )* + { + match(input,SEMICOLON,FOLLOW_SEMICOLON_in_node115); + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:14: ( property )* + loop4: + do { + int alt4=2; + int LA4_0 = input.LA(1); + + if ( ((LA4_0 >= 20 && LA4_0 <= 57)) ) { + alt4=1; + } + + + switch (alt4) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:31:15: property + { + pushFollow(FOLLOW_property_in_node118); + property4=property(); + + state._fsp--; + + + sgfNode.addProperty(property4); + + } + break; + + default : + break loop4; + } + } while (true); + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfNode; + } + // $ANTLR end "node" + + + + // $ANTLR start "property" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:33:1: property returns [SGFProperty sgfProperty] : ( ( numIdent ) ( ( LBRACKET numValue RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ | ( strIdent ) ( ( LBRACKET RBRACKET ) ) | ( strIdent ) ( ( LBRACKET strValue RBRACKET ) )+ | ( result ) ( ( LBRACKET strValue RBRACKET ) )+ | ( komi ) ( ( LBRACKET realValue RBRACKET ) )+ | ( coordIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ ); + public final SGFProperty property() throws RecognitionException { + SGFProperty sgfProperty = null; + + + SGFIdentifier numIdent5 =null; + + SGFParser.numValue_return numValue6 =null; + + SGFIdentifier playerIdent7 =null; + + SGFIdentifier playerIdent8 =null; + + SGFParser.coordValue_return coordValue9 =null; + + SGFIdentifier strIdent10 =null; + + SGFIdentifier strIdent11 =null; + + SGFParser.strValue_return strValue12 =null; + + SGFParser.strValue_return strValue13 =null; + + SGFParser.realValue_return realValue14 =null; + + SGFIdentifier coordIdent15 =null; + + SGFParser.coordValue_return coordValue16 =null; + + + + sgfProperty = new SGFProperty(); + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:2: ( ( numIdent ) ( ( LBRACKET numValue RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET RBRACKET ) )+ | ( playerIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ | ( strIdent ) ( ( LBRACKET RBRACKET ) ) | ( strIdent ) ( ( LBRACKET strValue RBRACKET ) )+ | ( result ) ( ( LBRACKET strValue RBRACKET ) )+ | ( komi ) ( ( LBRACKET realValue RBRACKET ) )+ | ( coordIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ ) + int alt12=8; + switch ( input.LA(1) ) { + case 34: + case 35: + case 36: + case 48: + case 49: + case 50: + { + alt12=1; + } + break; + case 28: + { + int LA12_2 = input.LA(2); + + if ( (LA12_2==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 2, input); + + throw nvae; + + } + } + break; + case 47: + { + int LA12_3 = input.LA(2); + + if ( (LA12_3==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 3, input); + + throw nvae; + + } + } + break; + case 24: + { + int LA12_4 = input.LA(2); + + if ( (LA12_4==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 4, input); + + throw nvae; + + } + } + break; + case 55: + { + int LA12_5 = input.LA(2); + + if ( (LA12_5==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 5, input); + + throw nvae; + + } + } + break; + case 32: + case 33: + { + int LA12_6 = input.LA(2); + + if ( (LA12_6==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 6, input); + + throw nvae; + + } + } + break; + case 38: + case 42: + { + int LA12_7 = input.LA(2); + + if ( (LA12_7==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 7, input); + + throw nvae; + + } + } + break; + case 40: + case 43: + { + int LA12_8 = input.LA(2); + + if ( (LA12_8==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 8, input); + + throw nvae; + + } + } + break; + case 25: + { + int LA12_9 = input.LA(2); + + if ( (LA12_9==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 9, input); + + throw nvae; + + } + } + break; + case 56: + { + int LA12_10 = input.LA(2); + + if ( (LA12_10==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 10, input); + + throw nvae; + + } + } + break; + case 46: + { + int LA12_11 = input.LA(2); + + if ( (LA12_11==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 11, input); + + throw nvae; + + } + } + break; + case 39: + case 41: + { + int LA12_12 = input.LA(2); + + if ( (LA12_12==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 12, input); + + throw nvae; + + } + } + break; + case 21: + { + int LA12_13 = input.LA(2); + + if ( (LA12_13==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 13, input); + + throw nvae; + + } + } + break; + case 29: + { + int LA12_14 = input.LA(2); + + if ( (LA12_14==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 14, input); + + throw nvae; + + } + } + break; + case 51: + { + int LA12_15 = input.LA(2); + + if ( (LA12_15==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 15, input); + + throw nvae; + + } + } + break; + case 30: + case 31: + { + int LA12_16 = input.LA(2); + + if ( (LA12_16==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 16, input); + + throw nvae; + + } + } + break; + case 26: + { + int LA12_17 = input.LA(2); + + if ( (LA12_17==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 17, input); + + throw nvae; + + } + } + break; + case 57: + { + int LA12_18 = input.LA(2); + + if ( (LA12_18==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 18, input); + + throw nvae; + + } + } + break; + case 23: + { + int LA12_19 = input.LA(2); + + if ( (LA12_19==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 19, input); + + throw nvae; + + } + } + break; + case 54: + { + int LA12_20 = input.LA(2); + + if ( (LA12_20==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 20, input); + + throw nvae; + + } + } + break; + case 52: + case 53: + { + int LA12_21 = input.LA(2); + + if ( (LA12_21==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 21, input); + + throw nvae; + + } + } + break; + case 27: + { + int LA12_22 = input.LA(2); + + if ( (LA12_22==LBRACKET) ) { + int LA12_26 = input.LA(3); + + if ( (LA12_26==RBRACKET) ) { + int LA12_27 = input.LA(4); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=2; + } + else if ( (true) ) { + alt12=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 27, input); + + throw nvae; + + } + } + else if ( (LA12_26==STRVALUE) ) { + int LA12_28 = input.LA(4); + + if ( (LA12_28==RBRACKET) ) { + int LA12_31 = input.LA(5); + + if ( ((((input.LT(1).getText().equals("Black")))||((input.LT(1).getText().equals("W")))||((input.LT(1).getText().equals("White")))||((input.LT(1).getText().equals("B"))))) ) { + alt12=3; + } + else if ( (true) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 31, input); + + throw nvae; + + } + } + else if ( (LA12_28==STRVALUE) ) { + alt12=5; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 28, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 26, input); + + throw nvae; + + } + } + else { + NoViableAltException nvae = + new NoViableAltException("", 12, 22, input); + + throw nvae; + + } + } + break; + case 44: + case 45: + { + alt12=6; + } + break; + case 37: + { + alt12=7; + } + break; + case 20: + case 22: + { + alt12=8; + } + break; + default: + NoViableAltException nvae = + new NoViableAltException("", 12, 0, input); + + throw nvae; + + } + + switch (alt12) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:4: ( numIdent ) ( ( LBRACKET numValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:4: ( numIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:5: numIdent + { + pushFollow(FOLLOW_numIdent_in_property140); + numIdent5=numIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(numIdent5); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:64: ( ( LBRACKET numValue RBRACKET ) )+ + int cnt5=0; + loop5: + do { + int alt5=2; + int LA5_0 = input.LA(1); + + if ( (LA5_0==LBRACKET) ) { + alt5=1; + } + + + switch (alt5) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:65: ( LBRACKET numValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:65: ( LBRACKET numValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:37:66: LBRACKET numValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property146); + + pushFollow(FOLLOW_numValue_in_property148); + numValue6=numValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property150); + + } + + + sgfProperty.addValue((numValue6!=null?numValue6.sgfValue:null)); + + } + break; + + default : + if ( cnt5 >= 1 ) break loop5; + EarlyExitException eee = + new EarlyExitException(5, input); + throw eee; + } + cnt5++; + } while (true); + + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:4: ( playerIdent ) ( ( LBRACKET RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:4: ( playerIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:5: playerIdent + { + pushFollow(FOLLOW_playerIdent_in_property164); + playerIdent7=playerIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(playerIdent7); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:71: ( ( LBRACKET RBRACKET ) )+ + int cnt6=0; + loop6: + do { + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0==LBRACKET) ) { + alt6=1; + } + + + switch (alt6) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:72: ( LBRACKET RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:72: ( LBRACKET RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:40:73: LBRACKET RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property170); + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property172); + + } + + + sgfProperty.addValue(SGFValue.EMPTY); + + } + break; + + default : + if ( cnt6 >= 1 ) break loop6; + EarlyExitException eee = + new EarlyExitException(6, input); + throw eee; + } + cnt6++; + } while (true); + + + } + break; + case 3 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:4: ( playerIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:4: ( playerIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:5: playerIdent + { + pushFollow(FOLLOW_playerIdent_in_property182); + playerIdent8=playerIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(playerIdent8); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:71: ( ( LBRACKET coordValue RBRACKET ) )+ + int cnt7=0; + loop7: + do { + int alt7=2; + int LA7_0 = input.LA(1); + + if ( (LA7_0==LBRACKET) ) { + alt7=1; + } + + + switch (alt7) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:72: ( LBRACKET coordValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:72: ( LBRACKET coordValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:41:73: LBRACKET coordValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property188); + + pushFollow(FOLLOW_coordValue_in_property190); + coordValue9=coordValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property192); + + } + + + sgfProperty.addValue(new SGFValue((coordValue9!=null?coordValue9.sgfCoord:null))); + + } + break; + + default : + if ( cnt7 >= 1 ) break loop7; + EarlyExitException eee = + new EarlyExitException(7, input); + throw eee; + } + cnt7++; + } while (true); + + + } + break; + case 4 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:4: ( strIdent ) ( ( LBRACKET RBRACKET ) ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:4: ( strIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:5: strIdent + { + pushFollow(FOLLOW_strIdent_in_property206); + strIdent10=strIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(strIdent10); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:64: ( ( LBRACKET RBRACKET ) ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:65: ( LBRACKET RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:65: ( LBRACKET RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:44:66: LBRACKET RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property212); + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property214); + + } + + + sgfProperty.addValue(SGFValue.EMPTY); + + } + + + } + break; + case 5 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:4: ( strIdent ) ( ( LBRACKET strValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:4: ( strIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:5: strIdent + { + pushFollow(FOLLOW_strIdent_in_property223); + strIdent11=strIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(strIdent11); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:64: ( ( LBRACKET strValue RBRACKET ) )+ + int cnt8=0; + loop8: + do { + int alt8=2; + int LA8_0 = input.LA(1); + + if ( (LA8_0==LBRACKET) ) { + alt8=1; + } + + + switch (alt8) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:65: ( LBRACKET strValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:65: ( LBRACKET strValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:45:66: LBRACKET strValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property229); + + pushFollow(FOLLOW_strValue_in_property231); + strValue12=strValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property233); + + } + + + sgfProperty.addValue(new SGFValue((strValue12!=null?input.toString(strValue12.start,strValue12.stop):null))); + + } + break; + + default : + if ( cnt8 >= 1 ) break loop8; + EarlyExitException eee = + new EarlyExitException(8, input); + throw eee; + } + cnt8++; + } while (true); + + + } + break; + case 6 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:4: ( result ) ( ( LBRACKET strValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:4: ( result ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:5: result + { + pushFollow(FOLLOW_result_in_property245); + result(); + + state._fsp--; + + + sgfProperty.setIdentifier(SGFIdentifier.RESULT); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:64: ( ( LBRACKET strValue RBRACKET ) )+ + int cnt9=0; + loop9: + do { + int alt9=2; + int LA9_0 = input.LA(1); + + if ( (LA9_0==LBRACKET) ) { + alt9=1; + } + + + switch (alt9) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:65: ( LBRACKET strValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:65: ( LBRACKET strValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:47:66: LBRACKET strValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property251); + + pushFollow(FOLLOW_strValue_in_property253); + strValue13=strValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property255); + + } + + + sgfProperty.addValue(new SGFValue(new SGFResult((strValue13!=null?input.toString(strValue13.start,strValue13.stop):null)))); + + } + break; + + default : + if ( cnt9 >= 1 ) break loop9; + EarlyExitException eee = + new EarlyExitException(9, input); + throw eee; + } + cnt9++; + } while (true); + + + } + break; + case 7 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:4: ( komi ) ( ( LBRACKET realValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:4: ( komi ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:5: komi + { + pushFollow(FOLLOW_komi_in_property267); + komi(); + + state._fsp--; + + + sgfProperty.setIdentifier(SGFIdentifier.KOMI); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:60: ( ( LBRACKET realValue RBRACKET ) )+ + int cnt10=0; + loop10: + do { + int alt10=2; + int LA10_0 = input.LA(1); + + if ( (LA10_0==LBRACKET) ) { + alt10=1; + } + + + switch (alt10) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:61: ( LBRACKET realValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:61: ( LBRACKET realValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:49:62: LBRACKET realValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property273); + + pushFollow(FOLLOW_realValue_in_property275); + realValue14=realValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property277); + + } + + + sgfProperty.addValue(new SGFValue(Double.parseDouble((realValue14!=null?input.toString(realValue14.start,realValue14.stop):null)))); + + } + break; + + default : + if ( cnt10 >= 1 ) break loop10; + EarlyExitException eee = + new EarlyExitException(10, input); + throw eee; + } + cnt10++; + } while (true); + + + } + break; + case 8 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:4: ( coordIdent ) ( ( LBRACKET coordValue RBRACKET ) )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:4: ( coordIdent ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:5: coordIdent + { + pushFollow(FOLLOW_coordIdent_in_property287); + coordIdent15=coordIdent(); + + state._fsp--; + + + sgfProperty.setIdentifier(coordIdent15); + + } + + + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:67: ( ( LBRACKET coordValue RBRACKET ) )+ + int cnt11=0; + loop11: + do { + int alt11=2; + int LA11_0 = input.LA(1); + + if ( (LA11_0==LBRACKET) ) { + alt11=1; + } + + + switch (alt11) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:68: ( LBRACKET coordValue RBRACKET ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:68: ( LBRACKET coordValue RBRACKET ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:50:69: LBRACKET coordValue RBRACKET + { + match(input,LBRACKET,FOLLOW_LBRACKET_in_property292); + + pushFollow(FOLLOW_coordValue_in_property294); + coordValue16=coordValue(); + + state._fsp--; + + + match(input,RBRACKET,FOLLOW_RBRACKET_in_property296); + + } + + + sgfProperty.addValue(new SGFValue(new SGFCoord((coordValue16!=null?input.toString(coordValue16.start,coordValue16.stop):null)))); + + } + break; + + default : + if ( cnt11 >= 1 ) break loop11; + EarlyExitException eee = + new EarlyExitException(11, input); + throw eee; + } + cnt11++; + } while (true); + + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfProperty; + } + // $ANTLR end "property" + + + + // $ANTLR start "playerIdent" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:54:1: playerIdent returns [SGFIdentifier sgfPlayer] : ({...}? strIdent |{...}? strIdent |{...}? strIdent |{...}? strIdent ); + public final SGFIdentifier playerIdent() throws RecognitionException { + SGFIdentifier sgfPlayer = null; + + + SGFIdentifier strIdent17 =null; + + SGFIdentifier strIdent18 =null; + + SGFIdentifier strIdent19 =null; + + SGFIdentifier strIdent20 =null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:55:2: ({...}? strIdent |{...}? strIdent |{...}? strIdent |{...}? strIdent ) + int alt13=4; + switch ( input.LA(1) ) { + case 28: + { + int LA13_1 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 1, input); + + throw nvae; + + } + } + break; + case 47: + { + int LA13_2 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 2, input); + + throw nvae; + + } + } + break; + case 24: + { + int LA13_3 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 3, input); + + throw nvae; + + } + } + break; + case 55: + { + int LA13_4 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 4, input); + + throw nvae; + + } + } + break; + case 32: + case 33: + { + int LA13_5 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 5, input); + + throw nvae; + + } + } + break; + case 38: + case 42: + { + int LA13_6 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 6, input); + + throw nvae; + + } + } + break; + case 40: + case 43: + { + int LA13_7 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 7, input); + + throw nvae; + + } + } + break; + case 25: + { + int LA13_8 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 8, input); + + throw nvae; + + } + } + break; + case 56: + { + int LA13_9 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 9, input); + + throw nvae; + + } + } + break; + case 46: + { + int LA13_10 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 10, input); + + throw nvae; + + } + } + break; + case 39: + case 41: + { + int LA13_11 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 11, input); + + throw nvae; + + } + } + break; + case 21: + { + int LA13_12 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 12, input); + + throw nvae; + + } + } + break; + case 29: + { + int LA13_13 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 13, input); + + throw nvae; + + } + } + break; + case 51: + { + int LA13_14 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 14, input); + + throw nvae; + + } + } + break; + case 30: + case 31: + { + int LA13_15 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 15, input); + + throw nvae; + + } + } + break; + case 26: + { + int LA13_16 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 16, input); + + throw nvae; + + } + } + break; + case 57: + { + int LA13_17 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 17, input); + + throw nvae; + + } + } + break; + case 23: + { + int LA13_18 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 18, input); + + throw nvae; + + } + } + break; + case 54: + { + int LA13_19 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 19, input); + + throw nvae; + + } + } + break; + case 52: + case 53: + { + int LA13_20 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 20, input); + + throw nvae; + + } + } + break; + case 27: + { + int LA13_21 = input.LA(2); + + if ( (((input.LT(1).getText().equals("W")))) ) { + alt13=1; + } + else if ( (((input.LT(1).getText().equals("B")))) ) { + alt13=2; + } + else if ( (((input.LT(1).getText().equals("White")))) ) { + alt13=3; + } + else if ( (((input.LT(1).getText().equals("Black")))) ) { + alt13=4; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 13, 21, input); + + throw nvae; + + } + } + break; + default: + NoViableAltException nvae = + new NoViableAltException("", 13, 0, input); + + throw nvae; + + } + + switch (alt13) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:55:4: {...}? strIdent + { + if ( !(((input.LT(1).getText().equals("W")))) ) { + throw new FailedPredicateException(input, "playerIdent", "(input.LT(1).getText().equals(\"W\"))"); + } + + pushFollow(FOLLOW_strIdent_in_playerIdent318); + strIdent17=strIdent(); + + state._fsp--; + + + sgfPlayer = strIdent17; + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:56:4: {...}? strIdent + { + if ( !(((input.LT(1).getText().equals("B")))) ) { + throw new FailedPredicateException(input, "playerIdent", "(input.LT(1).getText().equals(\"B\"))"); + } + + pushFollow(FOLLOW_strIdent_in_playerIdent327); + strIdent18=strIdent(); + + state._fsp--; + + + sgfPlayer = strIdent18; + + } + break; + case 3 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:57:4: {...}? strIdent + { + if ( !(((input.LT(1).getText().equals("White")))) ) { + throw new FailedPredicateException(input, "playerIdent", "(input.LT(1).getText().equals(\"White\"))"); + } + + pushFollow(FOLLOW_strIdent_in_playerIdent336); + strIdent19=strIdent(); + + state._fsp--; + + + sgfPlayer = strIdent19; + + } + break; + case 4 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:58:4: {...}? strIdent + { + if ( !(((input.LT(1).getText().equals("Black")))) ) { + throw new FailedPredicateException(input, "playerIdent", "(input.LT(1).getText().equals(\"Black\"))"); + } + + pushFollow(FOLLOW_strIdent_in_playerIdent345); + strIdent20=strIdent(); + + state._fsp--; + + + sgfPlayer = strIdent20; + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfPlayer; + } + // $ANTLR end "playerIdent" + + + + // $ANTLR start "strIdent" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:61:1: strIdent returns [SGFIdentifier sgfIdent] : ( charEnc | source | blackCountry | whiteCountry | event | playerBlack | playerWhite | blackRank | whiteRank | rules | place | application | copyright | username | date | 'Black' | 'White' | 'B' | 'W' | view | comment ); + public final SGFIdentifier strIdent() throws RecognitionException { + SGFIdentifier sgfIdent = null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:62:2: ( charEnc | source | blackCountry | whiteCountry | event | playerBlack | playerWhite | blackRank | whiteRank | rules | place | application | copyright | username | date | 'Black' | 'White' | 'B' | 'W' | view | comment ) + int alt14=21; + switch ( input.LA(1) ) { + case 28: + { + alt14=1; + } + break; + case 47: + { + alt14=2; + } + break; + case 24: + { + alt14=3; + } + break; + case 55: + { + alt14=4; + } + break; + case 32: + case 33: + { + alt14=5; + } + break; + case 38: + case 42: + { + alt14=6; + } + break; + case 40: + case 43: + { + alt14=7; + } + break; + case 25: + { + alt14=8; + } + break; + case 56: + { + alt14=9; + } + break; + case 46: + { + alt14=10; + } + break; + case 39: + case 41: + { + alt14=11; + } + break; + case 21: + { + alt14=12; + } + break; + case 29: + { + alt14=13; + } + break; + case 51: + { + alt14=14; + } + break; + case 30: + case 31: + { + alt14=15; + } + break; + case 26: + { + alt14=16; + } + break; + case 57: + { + alt14=17; + } + break; + case 23: + { + alt14=18; + } + break; + case 54: + { + alt14=19; + } + break; + case 52: + case 53: + { + alt14=20; + } + break; + case 27: + { + alt14=21; + } + break; + default: + NoViableAltException nvae = + new NoViableAltException("", 14, 0, input); + + throw nvae; + + } + + switch (alt14) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:62:4: charEnc + { + pushFollow(FOLLOW_charEnc_in_strIdent362); + charEnc(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.CHARSET; + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:63:10: source + { + pushFollow(FOLLOW_source_in_strIdent374); + source(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.SOURCE; + + } + break; + case 3 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:64:10: blackCountry + { + pushFollow(FOLLOW_blackCountry_in_strIdent386); + blackCountry(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.COUNTRY_BLACK; + + } + break; + case 4 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:65:10: whiteCountry + { + pushFollow(FOLLOW_whiteCountry_in_strIdent398); + whiteCountry(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.COUNTRY_WHITE; + + } + break; + case 5 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:66:4: event + { + pushFollow(FOLLOW_event_in_strIdent404); + event(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.EVENT; + + } + break; + case 6 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:67:4: playerBlack + { + pushFollow(FOLLOW_playerBlack_in_strIdent410); + playerBlack(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.PLAYER_BLACK; + + } + break; + case 7 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:68:4: playerWhite + { + pushFollow(FOLLOW_playerWhite_in_strIdent416); + playerWhite(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.PLAYER_WHITE; + + } + break; + case 8 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:69:4: blackRank + { + pushFollow(FOLLOW_blackRank_in_strIdent422); + blackRank(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.RANK_BLACK; + + } + break; + case 9 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:70:4: whiteRank + { + pushFollow(FOLLOW_whiteRank_in_strIdent428); + whiteRank(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.RANK_WHITE; + + } + break; + case 10 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:71:4: rules + { + pushFollow(FOLLOW_rules_in_strIdent434); + rules(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.RULES; + + } + break; + case 11 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:72:4: place + { + pushFollow(FOLLOW_place_in_strIdent440); + place(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.PLACE; + + } + break; + case 12 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:73:12: application + { + pushFollow(FOLLOW_application_in_strIdent454); + application(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.APPLICATION; + + } + break; + case 13 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:74:11: copyright + { + pushFollow(FOLLOW_copyright_in_strIdent467); + copyright(); + + state._fsp--; + + + } + break; + case 14 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:75:11: username + { + pushFollow(FOLLOW_username_in_strIdent479); + username(); + + state._fsp--; + + + } + break; + case 15 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:76:11: date + { + pushFollow(FOLLOW_date_in_strIdent491); + date(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.DATE; + + } + break; + case 16 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:77:11: 'Black' + { + match(input,26,FOLLOW_26_in_strIdent504); + + sgfIdent = SGFIdentifier.MOVE_BLACK; + + } + break; + case 17 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:78:11: 'White' + { + match(input,57,FOLLOW_57_in_strIdent517); + + sgfIdent = SGFIdentifier.MOVE_WHITE; + + } + break; + case 18 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:79:11: 'B' + { + match(input,23,FOLLOW_23_in_strIdent530); + + sgfIdent = SGFIdentifier.MOVE_BLACK; + + } + break; + case 19 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:80:11: 'W' + { + match(input,54,FOLLOW_54_in_strIdent543); + + sgfIdent = SGFIdentifier.MOVE_WHITE; + + } + break; + case 20 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:81:11: view + { + pushFollow(FOLLOW_view_in_strIdent556); + view(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.VIEW; + + } + break; + case 21 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:82:11: comment + { + pushFollow(FOLLOW_comment_in_strIdent570); + comment(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.COMMENT; + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfIdent; + } + // $ANTLR end "strIdent" + + + + // $ANTLR start "coordIdent" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:87:1: coordIdent returns [SGFIdentifier sgfIdent] : ( addBlack | addWhite ); + public final SGFIdentifier coordIdent() throws RecognitionException { + SGFIdentifier sgfIdent = null; + + + SGFIdentifier addBlack21 =null; + + SGFIdentifier addWhite22 =null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:88:2: ( addBlack | addWhite ) + int alt15=2; + int LA15_0 = input.LA(1); + + if ( (LA15_0==20) ) { + alt15=1; + } + else if ( (LA15_0==22) ) { + alt15=2; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 15, 0, input); + + throw nvae; + + } + switch (alt15) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:88:4: addBlack + { + pushFollow(FOLLOW_addBlack_in_coordIdent616); + addBlack21=addBlack(); + + state._fsp--; + + + sgfIdent = addBlack21; + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:89:5: addWhite + { + pushFollow(FOLLOW_addWhite_in_coordIdent624); + addWhite22=addWhite(); + + state._fsp--; + + + sgfIdent = addWhite22; + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfIdent; + } + // $ANTLR end "coordIdent" + + + + // $ANTLR start "numIdent" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:92:1: numIdent returns [SGFIdentifier sgfIdent] : ( fileFormat | game | size | time ); + public final SGFIdentifier numIdent() throws RecognitionException { + SGFIdentifier sgfIdent = null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:2: ( fileFormat | game | size | time ) + int alt16=4; + switch ( input.LA(1) ) { + case 34: + { + alt16=1; + } + break; + case 35: + case 36: + { + alt16=2; + } + break; + case 48: + case 49: + { + alt16=3; + } + break; + case 50: + { + alt16=4; + } + break; + default: + NoViableAltException nvae = + new NoViableAltException("", 16, 0, input); + + throw nvae; + + } + + switch (alt16) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:93:4: fileFormat + { + pushFollow(FOLLOW_fileFormat_in_numIdent641); + fileFormat(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.FILE_FORMAT; + + } + break; + case 2 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:94:4: game + { + pushFollow(FOLLOW_game_in_numIdent647); + game(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.GAME; + + } + break; + case 3 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:95:4: size + { + pushFollow(FOLLOW_size_in_numIdent653); + size(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.SIZE; + + } + break; + case 4 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:96:4: time + { + pushFollow(FOLLOW_time_in_numIdent659); + time(); + + state._fsp--; + + + sgfIdent = SGFIdentifier.TIME; + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfIdent; + } + // $ANTLR end "numIdent" + + + public static class numValue_return extends ParserRuleReturnScope { + public SGFValue sgfValue; + }; + + + // $ANTLR start "numValue" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:98:1: numValue returns [SGFValue sgfValue] : ( STRVALUE ) ; + public final SGFParser.numValue_return numValue() throws RecognitionException { + SGFParser.numValue_return retval = new SGFParser.numValue_return(); + retval.start = input.LT(1); + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:2: ( ( STRVALUE ) ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:5: ( STRVALUE ) + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:5: ( STRVALUE ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:99:6: STRVALUE + { + match(input,STRVALUE,FOLLOW_STRVALUE_in_numValue675); + + } + + + retval.sgfValue = new SGFValue(Integer.parseInt(input.toString(retval.start,input.LT(-1)))); + + } + + retval.stop = input.LT(-1); + + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "numValue" + + + + // $ANTLR start "realIdent" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:101:1: realIdent : komi ; + public final void realIdent() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:2: ( komi ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:102:4: komi + { + pushFollow(FOLLOW_komi_in_realIdent688); + komi(); + + state._fsp--; + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "realIdent" + + + public static class realValue_return extends ParserRuleReturnScope { + }; + + + // $ANTLR start "realValue" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:104:1: realValue : STRVALUE ; + public final SGFParser.realValue_return realValue() throws RecognitionException { + SGFParser.realValue_return retval = new SGFParser.realValue_return(); + retval.start = input.LT(1); + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:105:2: ( STRVALUE ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:105:4: STRVALUE + { + match(input,STRVALUE,FOLLOW_STRVALUE_in_realValue698); + + } + + retval.stop = input.LT(-1); + + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "realValue" + + + public static class coordValue_return extends ParserRuleReturnScope { + public SGFCoord sgfCoord; + }; + + + // $ANTLR start "coordValue" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:107:1: coordValue returns [SGFCoord sgfCoord] : STRVALUE ; + public final SGFParser.coordValue_return coordValue() throws RecognitionException { + SGFParser.coordValue_return retval = new SGFParser.coordValue_return(); + retval.start = input.LT(1); + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:108:2: ( STRVALUE ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:108:4: STRVALUE + { + match(input,STRVALUE,FOLLOW_STRVALUE_in_coordValue713); + + retval.sgfCoord = new SGFCoord(input.toString(retval.start,input.LT(-1))); + + } + + retval.stop = input.LT(-1); + + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "coordValue" + + + + // $ANTLR start "fileFormat" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:111:1: fileFormat : 'FF' ; + public final void fileFormat() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:112:2: ( 'FF' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:112:4: 'FF' + { + match(input,34,FOLLOW_34_in_fileFormat727); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "fileFormat" + + + + // $ANTLR start "game" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:114:1: game : ( 'GM' | 'GaMe' ); + public final void game() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:114:7: ( 'GM' | 'GaMe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 35 && input.LA(1) <= 36) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "game" + + + + // $ANTLR start "size" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:116:1: size : ( 'SZ' | 'SiZe' ); + public final void size() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:116:7: ( 'SZ' | 'SiZe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 48 && input.LA(1) <= 49) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "size" + + + + // $ANTLR start "view" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:118:1: view : ( 'VW' | 'VieW' ); + public final void view() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:118:7: ( 'VW' | 'VieW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 52 && input.LA(1) <= 53) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "view" + + + + // $ANTLR start "charEnc" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:120:1: charEnc : 'CA' ; + public final void charEnc() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:120:9: ( 'CA' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:120:11: 'CA' + { + match(input,28,FOLLOW_28_in_charEnc775); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "charEnc" + + + + // $ANTLR start "source" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:122:1: source : 'SO' ; + public final void source() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:122:8: ( 'SO' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:122:10: 'SO' + { + match(input,47,FOLLOW_47_in_source783); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "source" + + + + // $ANTLR start "blackCountry" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:124:1: blackCountry : 'BC' ; + public final void blackCountry() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:125:2: ( 'BC' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:125:4: 'BC' + { + match(input,24,FOLLOW_24_in_blackCountry793); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "blackCountry" + + + + // $ANTLR start "whiteCountry" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:127:1: whiteCountry : 'WC' ; + public final void whiteCountry() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:128:2: ( 'WC' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:128:4: 'WC' + { + match(input,55,FOLLOW_55_in_whiteCountry804); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "whiteCountry" + + + + // $ANTLR start "event" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:130:1: event : ( 'EV' | 'EVent' ); + public final void event() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:130:7: ( 'EV' | 'EVent' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 32 && input.LA(1) <= 33) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "event" + + + + // $ANTLR start "playerBlack" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:132:1: playerBlack : ( 'PB' | 'PlayerBlack' ); + public final void playerBlack() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:133:2: ( 'PB' | 'PlayerBlack' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( input.LA(1)==38||input.LA(1)==42 ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "playerBlack" + + + + // $ANTLR start "playerWhite" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:134:1: playerWhite : ( 'PW' | 'PlayerWhite' ); + public final void playerWhite() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:135:2: ( 'PW' | 'PlayerWhite' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( input.LA(1)==40||input.LA(1)==43 ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "playerWhite" + + + + // $ANTLR start "blackRank" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:136:1: blackRank : 'BR' ; + public final void blackRank() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:137:2: ( 'BR' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:137:4: 'BR' + { + match(input,25,FOLLOW_25_in_blackRank850); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "blackRank" + + + + // $ANTLR start "whiteRank" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:139:1: whiteRank : 'WR' ; + public final void whiteRank() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:140:2: ( 'WR' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:140:5: 'WR' + { + match(input,56,FOLLOW_56_in_whiteRank861); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "whiteRank" + + + + // $ANTLR start "komi" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:142:1: komi : 'KM' ; + public final void komi() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:142:7: ( 'KM' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:142:9: 'KM' + { + match(input,37,FOLLOW_37_in_komi871); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "komi" + + + + // $ANTLR start "result" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:144:1: result : ( 'RE' | 'REsult' ); + public final void result() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:144:9: ( 'RE' | 'REsult' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 44 && input.LA(1) <= 45) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "result" + + + + // $ANTLR start "rules" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:1: rules : 'RU' ; + public final void rules() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:7: ( 'RU' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:148:9: 'RU' + { + match(input,46,FOLLOW_46_in_rules897); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "rules" + + + + // $ANTLR start "place" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:150:1: place : ( 'PC' | 'PlaCe' ); + public final void place() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:150:8: ( 'PC' | 'PlaCe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( input.LA(1)==39||input.LA(1)==41 ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "place" + + + + // $ANTLR start "application" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:152:1: application : 'AP' ; + public final void application() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:153:2: ( 'AP' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:153:4: 'AP' + { + match(input,21,FOLLOW_21_in_application919); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "application" + + + + // $ANTLR start "time" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:155:1: time : 'TM' ; + public final void time() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:155:6: ( 'TM' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:155:8: 'TM' + { + match(input,50,FOLLOW_50_in_time928); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "time" + + + + // $ANTLR start "date" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:157:1: date : ( 'DT' | 'DaTe' ); + public final void date() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:157:7: ( 'DT' | 'DaTe' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g: + { + if ( (input.LA(1) >= 30 && input.LA(1) <= 31) ) { + input.consume(); + state.errorRecovery=false; + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "date" + + + + // $ANTLR start "addBlack" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:159:1: addBlack returns [SGFIdentifier sgfIdent] : 'AB' ; + public final SGFIdentifier addBlack() throws RecognitionException { + SGFIdentifier sgfIdent = null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:160:2: ( 'AB' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:160:4: 'AB' + { + match(input,20,FOLLOW_20_in_addBlack954); + + sgfIdent = SGFIdentifier.ADD_BLACK; + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfIdent; + } + // $ANTLR end "addBlack" + + + + // $ANTLR start "addWhite" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:163:1: addWhite returns [SGFIdentifier sgfIdent] : 'AW' ; + public final SGFIdentifier addWhite() throws RecognitionException { + SGFIdentifier sgfIdent = null; + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:164:2: ( 'AW' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:164:4: 'AW' + { + match(input,22,FOLLOW_22_in_addWhite971); + + sgfIdent = SGFIdentifier.ADD_WHITE; + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return sgfIdent; + } + // $ANTLR end "addWhite" + + + + // $ANTLR start "copyright" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:167:1: copyright : 'CP' ; + public final void copyright() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:168:2: ( 'CP' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:168:4: 'CP' + { + match(input,29,FOLLOW_29_in_copyright983); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "copyright" + + + + // $ANTLR start "username" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:170:1: username : 'US' ; + public final void username() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:170:9: ( 'US' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:170:11: 'US' + { + match(input,51,FOLLOW_51_in_username990); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "username" + + + + // $ANTLR start "comment" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:172:1: comment : 'C' ; + public final void comment() throws RecognitionException { + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:172:9: ( 'C' ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:172:11: 'C' + { + match(input,27,FOLLOW_27_in_comment998); + + } + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return ; + } + // $ANTLR end "comment" + + + public static class strValue_return extends ParserRuleReturnScope { + }; + + + // $ANTLR start "strValue" + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:174:1: strValue : ( STRVALUE )+ ; + public final SGFParser.strValue_return strValue() throws RecognitionException { + SGFParser.strValue_return retval = new SGFParser.strValue_return(); + retval.start = input.LT(1); + + + try { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:175:2: ( ( STRVALUE )+ ) + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:175:4: ( STRVALUE )+ + { + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:175:4: ( STRVALUE )+ + int cnt17=0; + loop17: + do { + int alt17=2; + int LA17_0 = input.LA(1); + + if ( (LA17_0==STRVALUE) ) { + alt17=1; + } + + + switch (alt17) { + case 1 : + // C:\\Users\\Woody\\Documents\\antlr\\SGF.g:175:5: STRVALUE + { + match(input,STRVALUE,FOLLOW_STRVALUE_in_strValue1009); + + } + break; + + default : + if ( cnt17 >= 1 ) break loop17; + EarlyExitException eee = + new EarlyExitException(17, input); + throw eee; + } + cnt17++; + } while (true); + + + } + + retval.stop = input.LT(-1); + + + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "strValue" + + // Delegated rules + + + + + public static final BitSet FOLLOW_gameTree_in_collection36 = new BitSet(new long[]{0x0000000000000202L}); + public static final BitSet FOLLOW_LPAREN_in_gameTree61 = new BitSet(new long[]{0x0000000000008000L}); + public static final BitSet FOLLOW_sequence_in_gameTree63 = new BitSet(new long[]{0x0000000000004200L}); + public static final BitSet FOLLOW_gameTree_in_gameTree67 = new BitSet(new long[]{0x0000000000004200L}); + public static final BitSet FOLLOW_RPAREN_in_gameTree72 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_node_in_sequence94 = new BitSet(new long[]{0x0000000000008002L}); + public static final BitSet FOLLOW_SEMICOLON_in_node115 = new BitSet(new long[]{0x03FFFFFFFFF00002L}); + public static final BitSet FOLLOW_property_in_node118 = new BitSet(new long[]{0x03FFFFFFFFF00002L}); + public static final BitSet FOLLOW_numIdent_in_property140 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property146 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_numValue_in_property148 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property150 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_playerIdent_in_property164 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property170 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property172 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_playerIdent_in_property182 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property188 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_coordValue_in_property190 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property192 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_strIdent_in_property206 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property212 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property214 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_strIdent_in_property223 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property229 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_strValue_in_property231 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property233 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_result_in_property245 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property251 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_strValue_in_property253 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property255 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_komi_in_property267 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property273 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_realValue_in_property275 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property277 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_coordIdent_in_property287 = new BitSet(new long[]{0x0000000000000080L}); + public static final BitSet FOLLOW_LBRACKET_in_property292 = new BitSet(new long[]{0x0000000000040000L}); + public static final BitSet FOLLOW_coordValue_in_property294 = new BitSet(new long[]{0x0000000000002000L}); + public static final BitSet FOLLOW_RBRACKET_in_property296 = new BitSet(new long[]{0x0000000000000082L}); + public static final BitSet FOLLOW_strIdent_in_playerIdent318 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_strIdent_in_playerIdent327 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_strIdent_in_playerIdent336 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_strIdent_in_playerIdent345 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_charEnc_in_strIdent362 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_source_in_strIdent374 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_blackCountry_in_strIdent386 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_whiteCountry_in_strIdent398 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_event_in_strIdent404 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_playerBlack_in_strIdent410 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_playerWhite_in_strIdent416 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_blackRank_in_strIdent422 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_whiteRank_in_strIdent428 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rules_in_strIdent434 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_place_in_strIdent440 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_application_in_strIdent454 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_copyright_in_strIdent467 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_username_in_strIdent479 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_date_in_strIdent491 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_26_in_strIdent504 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_57_in_strIdent517 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_23_in_strIdent530 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_54_in_strIdent543 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_view_in_strIdent556 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_comment_in_strIdent570 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_addBlack_in_coordIdent616 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_addWhite_in_coordIdent624 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_fileFormat_in_numIdent641 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_game_in_numIdent647 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_size_in_numIdent653 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_time_in_numIdent659 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRVALUE_in_numValue675 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_komi_in_realIdent688 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRVALUE_in_realValue698 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRVALUE_in_coordValue713 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_34_in_fileFormat727 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_28_in_charEnc775 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_47_in_source783 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_24_in_blackCountry793 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_55_in_whiteCountry804 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_25_in_blackRank850 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_56_in_whiteRank861 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_37_in_komi871 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_46_in_rules897 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_21_in_application919 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_50_in_time928 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_20_in_addBlack954 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_22_in_addWhite971 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_29_in_copyright983 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_51_in_username990 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_27_in_comment998 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRVALUE_in_strValue1009 = new BitSet(new long[]{0x0000000000040002L}); } \ No newline at end of file diff --git a/src/net/woodyfolsom/msproj/sgf/SGFProperty.java b/src/net/woodyfolsom/msproj/sgf/SGFProperty.java index 5c79115..307f7a2 100644 --- a/src/net/woodyfolsom/msproj/sgf/SGFProperty.java +++ b/src/net/woodyfolsom/msproj/sgf/SGFProperty.java @@ -36,4 +36,15 @@ public class SGFProperty { return sgfFormatString; } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(identifier.toString()); + for (SGFValue value : values) { + stringBuilder.append("["); + stringBuilder.append(value.toString()); + stringBuilder.append("]"); + } + return stringBuilder.toString(); + } } diff --git a/test/net/woodyfolsom/msproj/sgf/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf b/test/net/woodyfolsom/msproj/sgf/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf deleted file mode 100644 index af40f40..0000000 --- a/test/net/woodyfolsom/msproj/sgf/1334-gokifu-20120916-Gu_Li-Lee_Sedol.sgf +++ /dev/null @@ -1,15 +0,0 @@ -(;FF[4]GM[1]SZ[19]CA[UTF-8]SO[gokifu.com]BC[kr]WC[cn]EV[]PB[Lee Sedol]BR[9p]PW[Gu Li]WR[9p]KM[7.5] -DT[2012-09-16]RE[W+R];B[qd];W[dc];B[dq];W[do];B[pp];W[cq];B[de];W[cg];B[cc];W[gc];B[gd];W[hd];B[fc] -;W[fd];B[ge];W[fb];B[hc];W[ec];B[gb];W[fc];B[id];W[cd];B[he];W[oc];B[pe];W[qk];B[qi];W[qn];B[qo] -;W[pn];B[np];W[oj];B[oi];W[ni];B[nj];W[pi];B[oh];W[pj];B[ph];W[qh];B[qg];W[rh];B[ri];W[rg];B[rf] -;W[oo];B[op];W[mj];B[mc];W[nk];B[cr];W[cp];B[gq];W[md];B[nc];W[qf];B[sh];W[pg];B[sg];W[od];B[nd] -;W[oe];B[ne];W[nf];B[qg];W[og];B[nh];W[mh];B[mg];W[ng];B[qh];W[mf];B[lg];W[lf];B[ld];W[qc];B[rc] -;W[pb];B[rb];W[kg];B[lh];W[mi];B[dl];W[br];B[ce];W[bd];B[dg];W[dh];B[be];W[eg];B[fe];W[dd];B[df] -;W[ci];B[gl];W[fh];B[ad];W[bc];B[dr];W[dm];B[em];W[cm];B[gg];W[gh];B[jq];W[fo];B[il];W[hg];B[ho] -;W[lo];B[lq];W[kp];B[kq];W[ee];B[ef];W[ff];B[ed];W[gp];B[hq];W[ee];B[pf];W[of];B[ed];W[gn];B[ei] -;W[eh];B[ii];W[kd];B[kc];W[ke];B[nb];W[fl];B[fk];W[ek];B[fj];W[dj];B[gf];W[gm];B[kh];W[jh];B[jg] -;W[ig];B[jf];W[jd];B[je];W[kf];B[ki];W[jc];B[kb];W[jb];B[ib];W[ja];B[ob];W[ic];B[ih];W[ha];B[hb] -;W[ga];B[ma];W[hh];B[hk];W[kl];B[kk];W[jk];B[jj];W[lk];B[bg];W[bh];B[cf];W[ch];B[ag];W[ac];B[el] -;W[fm];B[ae];W[rn];B[ro];W[fq];B[fr];W[so];B[sp];W[sn];B[rp];W[gj];B[hj];W[ej];B[fi];W[gi];B[gk] -;W[bj];B[jl];W[kj];B[ik];W[fg];B[ee];W[eq];B[er];W[km];B[bs];W[ar];B[rk];W[rl];B[qj];W[no];B[mp] -;W[ql];B[qb];W[ia];B[hd];W[pc];B[pa];W[jo];B[hm];W[dp]) \ No newline at end of file diff --git a/test/net/woodyfolsom/msproj/sgf/CollectionTest.java b/test/net/woodyfolsom/msproj/sgf/CollectionTest.java index 41d2916..8bdc5d1 100644 --- a/test/net/woodyfolsom/msproj/sgf/CollectionTest.java +++ b/test/net/woodyfolsom/msproj/sgf/CollectionTest.java @@ -49,6 +49,7 @@ public class CollectionTest { SGFParser parser = new SGFParser(tokens); SGFNodeCollection nodeCollection = parser.collection(); - assertEquals(TEST_LATEX, nodeCollection.toLateX()); + String actualLaTeX = nodeCollection.toLateX(); + assertEquals(TEST_LATEX, actualLaTeX); } } diff --git a/test/net/woodyfolsom/msproj/sgf/SGFParserTest.java b/test/net/woodyfolsom/msproj/sgf/SGFParserTest.java index 1c89a7e..62cfbc7 100644 --- a/test/net/woodyfolsom/msproj/sgf/SGFParserTest.java +++ b/test/net/woodyfolsom/msproj/sgf/SGFParserTest.java @@ -31,4 +31,24 @@ public class SGFParserTest { System.out.println(""); } + + @Test + public void testParse9x9() throws RecognitionException, IOException { + FileInputStream fis = new FileInputStream(new File( + "data/games/pro9x9/game001.sgf")); + ANTLRStringStream in = new ANTLRInputStream(fis); + SGFLexer lexer = new SGFLexer(in); + CommonTokenStream tokens = new CommonTokenStream(lexer); + SGFParser parser = new SGFParser(tokens); + SGFNodeCollection nodeCollection = parser.collection(); + + System.out.println("To SGF:"); + System.out.println(nodeCollection.toSGF()); + System.out.println(""); + + System.out.println("To LaTeX:"); + System.out.println(nodeCollection.toLateX()); + System.out.println(""); + + } }