Compiler construction can be divided into several phases such as Lexical analysis, Syntax analysis, Semantic analysis and etc. In lexical analysis, there are tools such as Lex, Flex and etc. In syntax analysis, there are tools such as Yacc, Bison, etc. I'm just curious what are the tools available for semantic analysis phase?
相关问题
- How do shader compilers work?
- C++ Builder - Difference between Lib and Res
- Why does constructing std::string(0) not emit a co
- How do you parse a dangling else?
- Relation between MSVC Compiler & linker option for
相关文章
- How to force Delphi compiler to display all hints
- Xcode - How to change application/project name : w
- What other neat tricks does the SpecialNameAttribu
- What is the purpose of “-Wa,option” in GCC? [close
- Why does the C++ compiler give errors after lines
- Can a compiler inline a virtual function if I use
- Which x86 C++ compilers are multithreaded by itsel
- Undefined reference to fork() in Code::Blocks edit
To the best of my knowledge there are no language-agnostic tools to perform type checking and if there were, they'd certainly not be generally applicable as many language's type system's are too different and complex to be handled by generalized tools.
With scope resolution there's some room for tools to handle it for you. For example if your language has simple enough scoping rules, the XText framework can entirely take care of scope resolution for you if you add some annotations to your grammar. In more complex cases, you'll have to write some additional code yourself.
Then, if you compile to LLVM, you can use the LLVM framework to perform all kinds of control-flow analyses for you.