Language for semantic analysis?

background: - there are formal languages โ€‹โ€‹for expressing a programming language, a valid lexicon and syntax - such representations (for example, regular expression and context-free grammars) can be automatically compiled into lexicon / syntax analyzers for some programming language using some tools (for example, LEX and YACC)

questions: - Are there such formal languages โ€‹โ€‹for defining the semantics of a programming language? - Are there compilers for automating the generation of semantic analyzer code based on these formal languages? - any resources for reading semantic analysis of source code?

Notes: - you may find my question unrealistic, its good ... Am I new to compilers? - on semantic analysis, I really want to collect the necessary information from the source code for the next steps of optimization and code generation ... this should include type / border checking ... etc.

Hope I made it clear thanks a lot in advance

+3
source share
4 answers

: ( , ); ( ), ( , - ) ..

, . , . Peter Mosses - .

. , ( LEX YACC), . , , ( ). (C, Java, #, COBOL,...), , , , .

, : ? / , .

.

, , DMS Software Reengineering Toolkit, (, , anlaysis) , Java, C, ++ COBOL. DMS , .

+2

- google. Z ( wiki - ). lambda , , , ; , - , .

+3

, , , Centaur:

http://www-sop.inria.fr/croap/centaur/centaur.html

In fact, you could very far describe the semantics of your language, to such an extent that the system could give you an interpreter for that language (which is when you fully described the semantics). But you didnโ€™t have to go all the way. You could make fewer descriptions, and still get a structured editor and typechecker for your efforts.

Although the work has stopped in the project (as far as I can tell), you can find interesting articles and download from the links.

0
source

Source: https://habr.com/ru/post/1717551/


All Articles