private static Vt GetConstString(SyntaxTree syntaxTree) { ConstString result = null; if (syntaxTree.NodeType.Type == ContextfreeGrammarTreeNodeType.constStringLeave__) { string originalName = syntaxTree.NodeType.Content; originalName = originalName.Substring(1, originalName.Length - 2); string identifieredName = ConstString2IdentifierHelper.ConstString2Identifier(originalName); result = new ConstString(originalName, identifieredName); } return(result); }
private static string GetLexicalAnalyzerName(string grammarId) { SourceCodeCharType charType = grammarId[0].GetCharType(); if (charType == SourceCodeCharType.Letter || charType == SourceCodeCharType.UnderLine) { return(string.Format("{0}LexicalAnalyzer", ConstString2IdentifierHelper.ConstString2Identifier(grammarId))); } else { return(string.Format("_{0}LexicalAnalyzer", ConstString2IdentifierHelper.ConstString2Identifier(grammarId))); } }
private static string GetTreeNodeConstTypeName(string grammarId, SyntaxParserMapAlgorithm algorithm) { SourceCodeCharType charType = grammarId[0].GetCharType(); if (charType == SourceCodeCharType.Letter || charType == SourceCodeCharType.UnderLine) { return(string.Format("{0}{1}TreeNodeType", ConstString2IdentifierHelper.ConstString2Identifier(grammarId), algorithm)); } else { return(string.Format("_{0}{1}TreeNodeType", ConstString2IdentifierHelper.ConstString2Identifier(grammarId), algorithm)); } }
protected override string GetTokenName() { return(ConstString2IdentifierHelper.ConstString2Identifier("/")); }