Logo Search packages:      
Sourcecode: antlr version File versions

antlr::CSharpCodeGenerator Class Reference

Inheritance diagram for antlr::CSharpCodeGenerator:


List of all members.

Detailed Description

Generates MyParser.cs, MyLexer.cs and MyParserTokenTypes.cs

Definition at line 59 of file CSharpCodeGenerator.java.

Public Member Functions

 CSharpCodeGenerator ()
void exitIfError ()
void gen (ZeroOrMoreBlock blk)
void gen (WildcardElement wc)
void gen (TreeWalkerGrammar g) throws IOException
void gen (TreeElement t)
void gen (TokenRefElement atom)
void gen (TokenRangeElement r)
void gen (StringLiteralElement atom)
void gen (RuleRefElement rr)
void gen (ParserGrammar g) throws IOException
void gen (OneOrMoreBlock blk)
void gen (LexerGrammar g) throws IOException
void gen (CharRangeElement r)
void gen (CharLiteralElement atom)
void gen (BlockEndElement end)
void gen (AlternativeBlock blk)
void gen (ActionElement action)
void gen ()
void genBody (TreeWalkerGrammar g) throws IOException
void genBody (ParserGrammar g) throws IOException
void genBody (LexerGrammar g) throws IOException
CSharpBlockFinishingInfo genCommonBlock (AlternativeBlock blk, boolean noTestForSingle)
void genInitFactory (Grammar g)
void genNextToken ()
void genRule (RuleSymbol s, boolean startSymbol, int ruleNum, TokenManager tm)
void genTokenStrings ()
String getASTCreateString (String astCtorArgs)
String getASTCreateString (GrammarAtom atom, String astCtorArgs)
String getASTCreateString (Vector v)
String getFIRSTBitSet (String ruleName, int k)
String getFOLLOWBitSet (String ruleName, int k)
String getRangeExpression (int k, int[] elems)
String getTokenTypesClassName ()
String mapTreeId (String idParam, ActionTransInfo transInfo)
String processStringForASTConstructor (String str)
void setAnalyzer (LLkGrammarAnalyzer analyzer_)
void setBehavior (DefineGrammarSymbols behavior_)
void setTool (Tool tool)
void setupOutput (String className) throws IOException

Static Public Member Functions

static String decodeLexerRuleName (String id)
static boolean elementsAreRange (int[] elems)
static String encodeLexerRuleName (String id)
static String reverseLexerRuleName (String id)

Static Public Attributes

static final int caseSizeThreshold = 127
static String TokenTypesFileExt = ".txt"
static String TokenTypesFileSuffix = "TokenTypes"

Protected Member Functions

void _print (String s)
void _printAction (String s)
void _println (String s)
int addSemPred (String predicate)
String extractIdOfAction (String s, int line, int column)
String extractIdOfAction (Token t)
String extractTypeOfAction (String s, int line, int column)
String extractTypeOfAction (Token t)
void genAlt (Alternative alt, AlternativeBlock blk)
void genASTDeclaration (AlternativeElement el, String var_name, String node_type)
void genASTDeclaration (AlternativeElement el, String node_type)
void genASTDeclaration (AlternativeElement el)
void genBitsets (Vector bitsetList, int maxVocabulary)
void genBlockInitAction (AlternativeBlock blk)
void genBlockPreamble (AlternativeBlock blk)
void genCases (BitSet p)
void genHeader ()
void genMatch (GrammarAtom atom)
void genMatch (BitSet b)
void genMatchUsingAtomText (GrammarAtom atom)
void genMatchUsingAtomTokenType (GrammarAtom atom)
void genSemPred (String pred, int line)
void genSemPredMap ()
void genSynPred (SynPredBlock blk, String lookaheadExpr)
void genTokenDefinitions (TokenManager tm) throws IOException
void genTokenInterchange (TokenManager tm) throws IOException
void genTokenTypes (TokenManager tm) throws IOException
String getBitsetName (int index)
String getLookaheadTestExpression (Alternative alt, int maxDepth)
String getLookaheadTestExpression (Lookahead[] look, int k)
String getLookaheadTestTerm (int k, BitSet p)
boolean lookaheadIsEmpty (Alternative alt, int maxDepth)
int markBitsetForGen (BitSet p)
void print (String s)
void printAction (String s)
void println (String s)
void printTabs ()
String processActionForSpecialSymbols (String actionStr, int line, RuleBlock currentRule, ActionTransInfo tInfo)
String removeAssignmentFromDeclaration (String d)
void setGrammar (Grammar g)

Protected Attributes

LLkGrammarAnalyzer analyzer
antlr.Tool antlrTool
DefineGrammarSymbols behavior
Vector bitsetsUsed
CharFormatter charFormatter
transient PrintWriter currentOutput
boolean DEBUG_CODE_GENERATOR = false
boolean genAST = false
Grammar grammar = null
boolean saveText = false
int syntacticPredLevel = 0
int tabs = 0

Static Protected Attributes

static final String NONUNIQUE = new String()

Package Attributes

int astVarNumber = 1
boolean bSaveIndexCreated = false
String commonExtraArgs
String commonExtraParams
String commonLocalVars
String currentASTResult
RuleBlock currentRule
HashSet declaredASTVariables = new HashSet()
String exceptionThrown
String labeledElementASTType
String labeledElementInit
String labeledElementType
String lt1Value
String throwNoViable
Hashtable treeVariableMap = new Hashtable()
boolean usingCustomAST = false

Private Member Functions

void declareSaveIndexVariableIfNeeded ()
void genBitSet (BitSet p, int id)
void genBlockFinish (CSharpBlockFinishingInfo howToFinish, String noViableAction)
void genElementAST (AlternativeElement el)
void genErrorCatchForElement (AlternativeElement el)
void genErrorHandler (ExceptionSpec ex)
void genErrorTryForElement (AlternativeElement el)
void genLiteralsTest ()
void genLiteralsTestForPartialToken ()
void GenRuleInvocation (RuleRefElement rr)
String getValueString (int value)
String lookaheadString (int k)
String mangleLiteral (String s)
void mapTreeVariable (AlternativeElement e, String name)
void setupGrammarParameters (Grammar g)

Static Private Member Functions

static String OctalToUnicode (String str)
static boolean suitableForCaseExpression (Alternative a)

Private Attributes

java.util.Vector astTypes
Vector semPreds

Static Private Attributes

static CSharpNameSpace nameSpace = null

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index