tag:blogger.com,1999:blog-27232680.post5131180311814462642..comments2024-03-20T06:54:32.435+01:00Comments on Plastic SCM blog: Custom languages in semantic version controlF3RD3Fhttp://www.blogger.com/profile/11524626976811746062noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-27232680.post-5092088828904041722015-09-16T23:35:22.406+02:002015-09-16T23:35:22.406+02:00Cool! I guess we would have to configure additiona...Cool! I guess we would have to configure additional include paths for the parser, then. But I see the problem when you have to load includes from each of the involved changesets in a merge... Thanks for the comment, I was clearly too naive! :PGöran W.https://www.blogger.com/profile/08480594756782753172noreply@blogger.comtag:blogger.com,1999:blog-27232680.post-5058826932325282772015-09-16T22:46:29.109+02:002015-09-16T22:46:29.109+02:00The problem is that in C++ you can't "sta...The problem is that in C++ you can't "start small". And customers don't like "starting small things" because every possible little detail you postpone to be implemented "later on" will be immediately requested and highlighted as a bug fix when not a show-stopper :-S<br /><br />Going back to the C++ specific stuff: we're using libclang to parse C++. Trying to implement your own parser, for C++, is ... well, crazy, because it is probably the hardest to parse.<br /><br />And then, the test we perform to approve a parser is as follows:<br />* Parse about 2 million files.<br />* Convert them to our intermediate structure (sort of an AST).<br />* Rebuild the original file from the intermediate.<br />* Check we don't break anything - if we do the parsing wouldn't be good enough for merging... cause coders, for some reason, don't want the merge tool to break their files XD.<br /><br />The C++ parser can't guarantee that unless you parse the entire declarations correctly...<br /><br />We'll see if we can do something for diffs, leaving merges out...Pablo Santoshttps://www.blogger.com/profile/08083682682597484025noreply@blogger.comtag:blogger.com,1999:blog-27232680.post-57713655747850985462015-09-16T22:19:37.893+02:002015-09-16T22:19:37.893+02:00Does the parsing (for c++) have to go so deep as t...Does the parsing (for c++) have to go so deep as to parse included files and understand every statement? Can't we start by getting the basic structure right - classes, structs, methods etc? Look for keywords and delimiters, seeing unknown (type)names as placeholders. I may be too naive here, and I realize that ill-formed preproc macros can easily break the parser. Templates are difficult too, I'm afraid...Göran W.https://www.blogger.com/profile/08480594756782753172noreply@blogger.comtag:blogger.com,1999:blog-27232680.post-79938438293247977192015-09-09T12:39:57.198+02:002015-09-09T12:39:57.198+02:00Not really. I don't think the C++ parser can b...Not really. I don't think the C++ parser can be implemented externally unless I'm missing a key simplification, which would be great to find.<br /><br />Parsing C++ requires accessing include files, even for a single source file. And the files to be accessed could be outside the working copy, or belong to previous versions, so some sort of interface to access the right file on src and dst will be requried.Pablo Santoshttps://www.blogger.com/profile/08083682682597484025noreply@blogger.comtag:blogger.com,1999:blog-27232680.post-36071352825593733602015-09-09T12:06:34.881+02:002015-09-09T12:06:34.881+02:00Does this mean you're not going to finish the ...Does this mean you're not going to finish the C++ parser ?Petehttps://www.blogger.com/profile/11724181600233822807noreply@blogger.com