semantic-analysis

Context-aware merge?

那年仲夏 提交于 2019-11-27 07:05:41
Is there any diff/merge tool for programming languages, that works in a syntax-aware way (like XML Diff Tool), doing more than compare line-by-line (and optionally ignoring whitespace). I'm interested in a program actually following the language syntax and delimeters, suggesting changes without breaking syntactic correctness, or bundling statements separated over multiple lines. Example behavior would be: *upon finding an if(){ which introduces an extra nesting level automatically bundle the closing brace } several lines below with it.) *keep matching syntax elements together, avoid silliness

Context-aware merge?

吃可爱长大的小学妹 提交于 2019-11-26 13:02:22
问题 Is there any diff/merge tool for programming languages, that works in a syntax-aware way (like XML Diff Tool), doing more than compare line-by-line (and optionally ignoring whitespace). I\'m interested in a program actually following the language syntax and delimeters, suggesting changes without breaking syntactic correctness, or bundling statements separated over multiple lines. Example behavior would be: *upon finding an if(){ which introduces an extra nesting level automatically bundle the

What is the difference between an Abstract Syntax Tree and a Concrete Syntax Tree?

一个人想着一个人 提交于 2019-11-26 05:42:26
问题 I\'ve been reading a bit about how interpreters/compilers work, and one area where I\'m getting confused is the difference between an AST and a CST. My understanding is that the parser makes a CST, hands it to the semantic analyzer which turns it into an AST. However, my understanding is that the semantic analyzer simply ensures that rules are followed. I don\'t really understand why it would actually make any changes to make it abstract rather than concrete. Is there something that I\'m