private void convertSingleProduction ( String productionName , ParseTreeNode productionConstruction ) throws TreeException , GrammarException { ParseTreeNode alternativeIdentifier = productionConstruction . getChild ( "AlternativeIdentifier" ) ; Production production ; if ( alternativeIdentifier == null ) { production = new Production ( productionName ) ; } else { ParseTreeNode alternativeIdentifierName = alternativeIdentifier . getChild ( "IDENTIFIER" ) ; if ( alternativeIdentifierName == null ) { production = new Production ( productionName ) ; } else { production = new Production ( productionName , alternativeIdentifierName . getText ( ) ) ; } } production . addAllConstructions ( getConstructions ( productionConstruction ) ) ; addOptions ( production , productionConstruction ) ; productions . add ( production ) ; }
This method converts a single production from a list of productions within a production group into a single production . Some additional productions might be created during the way due to construction grouping and quantifiers .