Click here to Skip to main content
15,860,859 members
Articles / Programming Languages / C#

CodeDom Assistant

Rate me:
Please Sign up or sign in to vote.
4.84/5 (26 votes)
21 Sep 20074 min read 136.5K   6.6K   82  
Generating CodeDom Code By Parsing C# or VB
# this list is used for autogeneration of:
# - Keywords.cs
# - Tokens.cs
# - ATGTokensSection.txt - the TOKENS section of the ATG file

# use BuildKeywords to generate the different lists.

$Namespace=ICSharpCode.NRefactory.Parser.VB
$UpperCaseKeywords=True

# TERMINAL_CLASSES
EOF
EOL
Identifier
LiteralString
LiteralCharacter
LiteralInteger
LiteralDouble
LiteralSingle
LiteralDecimal
LiteralDate

# SPECIAL_CHARACTERS
Dot = "."
Assign = "="
Comma = ","
Colon =":"
Plus = "+"
Minus = "-"
Times = "*"
Div ="/"
DivInteger = "\\"
ConcatString = "&"
Power = "^"
# Question mark is not needed by VB8, but we use it inside the IDE
QuestionMark = "?"

OpenCurlyBrace = "{"
CloseCurlyBrace = "}"
	
OpenParenthesis = "("
CloseParenthesis = ")"
	
GreaterThan = ">"
LessThan = "<"
	
NotEqual = "<>"
GreaterEqual = ">="
LessEqual = "<="
	
ShiftLeft = "<<"
ShiftRight = ">>"
	
PlusAssign = "+="
PowerAssign = "^="
MinusAssign = "-="
TimesAssign = "*="
DivAssign = "/="
DivIntegerAssign = "\\="
ShiftLeftAssign = "<<="
ShiftRightAssign = ">>="
ConcatStringAssign = "&="

# keywords according to the spec:
# Keywordlist
"AddHandler"
"AddressOf"
"Alias"
"And"
"AndAlso"
"Ansi"
"As"
"Assembly"
"Auto"
"Binary"
"Boolean"
"ByRef"
"Byte"
"ByVal"
"Call"
"Case"
"Catch"
"CBool"
"CByte"
"CChar"
"CDate"
"CDbl"
"CDec"
"Char"
"CInt"
"Class"
"CLng"
"CObj"
"Compare"
"Const"
"CShort"
"CSng"
"CStr"
"CType"
"Date"
"Decimal"
"Declare"
"Default"
"Delegate"
"Dim"
"DirectCast"
"Do"
"Double"
"Each"
"Else"
"ElseIf"
"End"
"EndIf"
"Enum"
"Erase"
"Error"
"Event"
"Exit"
"Explicit"
"False"
"Finally"
"For"
"Friend"
"Function"
"Get"
"GetType"
"GoSub"
"GoTo"
"Handles"
"If"
"Implements"
"Imports"
"In"
"Inherits"
"Integer"
"Interface"
"Is"
"Let"
"Lib"
"Like"
"Long"
"Loop"
"Me"
"Mod"
"Module"
"MustInherit"
"MustOverride"
"MyBase"
"MyClass"
"Namespace"
"New"
"Next"
"Not"
"Nothing"
"NotInheritable"
"NotOverridable"
"Object"
"Off"
"On"
"Option"
"Optional"
"Or"
"OrElse"
"Overloads"
"Overridable"
"Overrides"
"ParamArray"
"Preserve"
"Private"
"Property"
"Protected"
"Public"
"RaiseEvent"
"ReadOnly"
"ReDim"
"RemoveHandler"
"Resume"
"Return"
"Select"
"Set"
"Shadows"
"Shared"
"Short"
"Single"
"Static"
"Step"
"Stop"
"Strict"
"String"
"Structure"
"Sub"
"SyncLock"
"Text"
"Then"
"Throw"
"To"
"True"
"Try"
"TypeOf"
"Unicode"
"Until"
"Variant"
"Wend"
"When"
"While"
"With"
"WithEvents"
"WriteOnly"
"Xor"

# VB.NET 2.0 Keywords:
"Continue"
"Operator"
"Using"
"IsNot"
# Note: IsTrue and IsFalse are 'NOT' keywords they're only valid in Operator declarations (like get/set/value are no C# 'keywords')
"SByte"
"UInteger"
"ULong"
"UShort"
"CSByte"
"CUShort"
"CUInt"
"CULng"
"Global"
"TryCast"
"Of"
"Narrowing"
"Widening"
"Partial"
"Custom"

#Sets
Null("Nothing")
BlockSucc("Case", "Catch", "Else", "ElseIf", "End", "Finally", "Loop", "Next")

# List of unreserved keywords, must be the same as the "Identifier" production in VBNET.ATG
Unreserved("Text", "Binary", "Compare", "Assembly", "Ansi", "Auto", "Preserve", "Unicode", "Until", "Explicit", "Off")

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Australia Australia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions