I want to write a new templating language, and I want Visual Studio to "support" it. What I need to know is:
- How do I parse my new language?
Given some code in my new template language, how do I translate it into HTML? Right now I'm using regular expressions to parse it token by token, but I don't think this is going to scale very well as the language gets more complicated, and there's no error checking. I've heard of ANTLR but never used it. Would that be the right tool for this job, or is there perhaps something simpler? Ideally I'd like to send any syntax errors to the error window with as much information as possible (line #, type of error) like other languages do.
- How do I create a new file type for Visual Studio?
- How do I get syntax highlighting?
Can I use the same parser I created in step 1, or is this something entirely different?
- How do I get Intellisense?
I'd prefer to write my parser in C#.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…