Supplements for “Language Design and Implementation for the Domain of Coding Conventions”

Boryana Goncharenko⋆‡ and Vadim Zaytsev⋆†

⋆University of Amsterdam, The Netherlands †Raincode, Belgium ‡Amazon, The Netherlands Contents – Appendix A. Claim 1 Dataset – Appendix B. Claim 2 Dataset – Appendix C. CSS Research – Appendix D. Abstract Object-oriented Syntax – Appendix E. Concrete Textual Syntax – Appendix F. CssCoco Plugin

Appendix A. Claim 1 Dataset

Number Classification link to general link to wikipedia.org general link to wikipedia.org 1 Java link to oracle.com 2 Java link to oracle.com 3 Basic link to xoc.net 4 C# link to microsoft.com 5 Matlab link to columbia.edu 6 JS link to .crockford.com 7 JS link to sideeffect.kr 8 Java link to sideeffect.kr 9 Python link to sideeffect.kr 10 Scala link to sideeffect.kr 11 Ruby link to sideeffect.kr 12 C# link to sideeffect.kr 13 PHP link to sideeffect.kr 14 C/C++ link to gcc.gnu.org 15 PHP link to .org 16 PHP link to cakephp.org 17 Java link to source.android.com general link to c2.com 18 PHP link to wordpress.org 19 HTML link to wordpress.org 20 CSS link to wordpress.org 21 JS link to wordpress.org data link to nisra.gov.uk 22 C/C++ link to cs.rice.edu 23 C/C++ link to llvm.org 24 PHP link to drupal.org data link to nisra.gov.uk 25 JS link to aviyehuda.com 26 PHP link to stackoverflow.com 27 Java link to stackoverflow.com 28 Java link to stackoverflow.com 29 C# link to stackoverflow.com data link to unspsc.org general link to articlesontesting.com 30 SQL link to articlesontesting.com 31 JS link to gist.github.com 32 JS link to npmjs.com 33 C# link to stackexchange.com hardware link to dasplace.net 34 C/C++ link to google.github.io out of scope link to sourceforge.net 35 Fortran link to fortran.com out of scope link to teslamotorsclub.com 36 C/C++ link to research.microsoft.com 37 C/C++ link to codemuri.tistory.com 38 Fortran link to water.usgs.gov 39 Lisp link to cliki.net 40 Stat link to dell.com out of scope link to stniccc.com 41 Java link to quora.com 42 C/C++ link to codemuri.tistory.com 43 HTML link to gitbook.com 44 CSS link to gitbook.com 45 JS link to gitbook.com out of scope link to gofundme.com data link to medicaidalaska.com out of scope link to demozoo.org 46 C/C++ link to aliweb.cern.ch 47 Java link to slideshare.net 48 C/C++ link to sbin.org data link to collaboratemd.com 49 C/C++ link to fnal.gov 50 Python link to python.org 51 C/C++ link to freertos.org 52 C# link to worknet.googlecode.com 53 C/C++ link to image.diku.dk 54 Fortran link to cesm.ucar.edu data link to provcomm.ibx.com 55 ObjC link to developer.apple.com 56 ML link to it.uu.se 57 Java link to researchgate.net 58 C/C++ link to unrealengine.com data link to aace.com data link to lewisham.gov.uk hardware link to comprion.com 59 C# link to dotnetfunda.com 60 Paradox link to prestwood.com 61 Java link to mindprod.com duplicate link to hashnode.com hardware link to quizlet.com 62 Java link to geosoft.no 63 Flex link to infoq.com duplicate link to elsevier.com 64 C/C++ link to cws.cengage.co.uk out of scope link to eventbrite.de out of scope link to eventbrite.co.uk 65 C/C++ link to hackaday.com 66 C/C++ link to pjsip.org visual link to serverfault.com 67 R link to r-bloggers.com general link to carlopescio.com 68 ObjC link to corgitoergosum.net data link to fortherecordmag.com 69 Rust link to rust-lang.org 70 C/C++ link to softwareprojects.com 71 PHP link to softwareprojects.com 72 PHP link to exakat.io 73 Java link to apache.org 74 C/C++ link to software-dl.ti.com data link to help.pointforce.com general link to drdobbs.com 75 PHP link to osticket.com 76 PHP link to slideshare.net 77 C/C++ link to geeks3d.com duplicate link to cern.ch 78 C/C++ link to wireshark.org 79 ASP .NET link to visualstudiomagazine.com 80 C/C++ link to ludumdare.com 81 C/C++ link to scribd.com data link to erm-crm.org 82 Java link to prezi.com data link to books.google.com 83 ObjC link to groups.google.com data link to zxdemo.org out of scope link to djangocon.eu 84 C/C++ link to joelonsoftware.com data link to medicaidalaska.com 85 HTML link to navercorp.com 86 CSS link to navercorp.com 87 Java link to arxiv.org 88 Ruby link to rorlab.gitbooks.io 89 C/C++ link to pjsip.org 90 Fortran link to worldcat.org data link to amerihealth.com data link to fresh.unh.edu data link to books.google.com general link to polleverywhere.com 91 PHP link to codeigniter.com data link to atari-forum.com 92 C/C++ link to cprogramming.com 93 Java link to geotools.org hardware link to tomshardware.com 94 C/C++ link to google-melange.com 95 C/C++ link to tizen.org 96 XAML link to dotnetapp.com 97 C/C++ link to nanapro.org 98 Python link to bigbrotherbot.net 99 C/C++ link to rtems.org 100 Java link to liferay.com Appendix B. Claim 2 Dataset

Language Results Privatelee query SQL 75102 “coding+convention”+sql 52801 “coding+convention”+perl Fortran 34701 “coding+convention”+fortran CSS 33602 “coding+convention”+AND+%28css+OR+cascading+style+sheets%29 HTML 29402 “coding+convention”+html VB 25301 “coding+convention”+vb Java 24702 “coding+convention”+java PHP 19702 “coding+convention”+ C++ 17302 “coding+convention”+c%2B%2B JS 16802 “coding+convention”+javascript bash 13100 “coding+convention”+bash ObjC 11901 “coding+convention”+AND+%28swift+OR+objective+c%29 Python 11302 “coding+convention”+python Matlab 11300 “coding+convention”+matlab C# 10801 “coding+convention”+c# Abap 9940 “coding+convention”+abap Scala 9110 “coding+convention”+scala Lisp 6011 “coding+convention”+lisp Groovy 5910 “coding+convention”+groovy Ruby 5141 “coding+convention”+ruby Ada 5110 “coding+convention”+ada Cobol 3770 “coding+convention”+cobol Lua 3420 “coding+convention”+lua Dart 2860 “coding+convention”+dart Prolog 2290 “coding+convention”+prolog Rust 1270 “coding+convention”+rust potato 997 “coding+convention”+potato Appendix C. CSS Research

This appendix contains all 41 papers with “CSS” or “Cascading Style Sheets” in the title, that were ever published on a CSS-related topic in a peer reviewed journal, magazine or proceedings volume.

References

1. César F. Acebal, Bert Bos, María Rodríguez, and Juan Manuel Cueva Lovelle. ALMcss: a Javascript Implementation of the CSS Template Layout Module. In Cyril Concolato and Patrick Schmitz, editors, ACM Symposium on Document En- gineering (DocEng), pages 23–32. ACM, 2012. doi:10.1145/2361354.2361360. 2. Adewole Adewumi, Sanjay Misra, and Nicholas Ikhu-Omoregbe. Complexity Met- rics for Cascading Style Sheets. In Beniamino Murgante, Osvaldo Gervasi, Sanjay Misra, Nadia Nedjah, Ana Maria A. C. Rocha, David Taniar, and Bernady O. Apduhan, editors, Proceedings of the 12th International Conference on Compu- tational Science and its Applications (ICCSA), Part IV, volume 7336 of LNCS, pages 248–257. Springer, 2012. doi:10.1007/978-3-642-31128-4_18 . 3. Amaia Aizpurua, Myriam Arrue, Markel Vigo, and Julio Abascal. Exploring Au- tomatic CSS Accessibility Evaluation. In Martin Gaedke, Michael Grossniklaus, and Oscar Díaz, editors, Proceedings of the Ninth International Conference on Web Engineering (ICWE), volume 5648 of LNCS, pages 16–29. Springer, 2009. doi:10.1007/978-3-642-02818-2_2 . 4. Kehinde Alabi. Generation, Documentation and Presentation of Mathematical Equations and Symbolic Scientific Expressions Using Pure HTML and CSS. In Carey L. Williamson, Mary Ellen Zurko, Peter F. Patel-Schneider, and Prashant J. Shenoy, editors, Proceedings of the 16th International Conference on World Wide Web (WWW), pages 1321–1322. ACM, 2007. doi:10.1145/1242572.1242830. 5. Greg J. Badros, Alan Borning, Kim Marriott, and Peter J. Stuckey. Constraint Cascading Style Sheets for the Web. In Brad T. Vander Zanden and Joe Marks, ed- itors, Proceedings of the 12th Annual ACM Symposium on User Interface Software and Technology (UIST), pages 73–82. ACM, 1999. doi:10.1145/320719.322588. 6. M. Serdar Biçer and Banu Diri. Defect Prediction for Cascading Style Sheets. Applied Soft Computing, 2016. In press, corrected proof, available online 30 May 2016. doi:10.1016/j.asoc.2016.05.038. 7. Martí Bosch, Pierre Genevès, and Nabil Layaïda. Automated Refactoring for Size Reduction of CSS Style Sheets. In ACM Symposium on Document Engineering (DocEng), pages 13–16. ACM, 2014. doi:10.1145/2644866.2644885. 8. Yung-Chen Chou and Hsin-Chi Liao. A Webpage Data Hiding Method by Using Tag and CSS Attribute Setting. In Junzo Watada, Akinori Ito, Jeng-Shyang Pan, Han-Chieh Chao, and Chien-Ming Chen, editors, Proceedings of the Tenth Inter- national Conference on Intelligent Information Hiding and Multimedia Signal Pro- cessing (IIH-MSP), pages 122–125. IEEE, 2014. doi:10.1109/IIH-MSP.2014.37 . 9. Alessandro Cogliati, Mikko Pohja, and Petri Vuorimaa. XHTML and CSS Com- ponents in an XML Browser. In Hamid R. Arabnia and Youngsong Mun, editors, Proceedings of the International Conference on Internet Computing (IC), Volume 2, pages 563–572. CSREA Press, 2003. 10. Alessandro Cogliati and Petri Vuorimaa. Optimized CSS Engine. In José A. Moin- hos Cordeiro, Vitor Pedrosa, Bruno Encarnação, and Joaquim Filipe, editors, Pro- ceedings of the Second International Conference on Web Information Systems and Technologies: Internet Technology / Web Interface and Applications (WEBIST), pages 206–213. INSTICC Press, 2006. 11. Stuart Culshaw, Michael Leventhal, and Murray Maloney. XML and CSS. World Wide Web Journal, 2(4):109–118, 1997. URL: http://www.xml.com/pub/a/w3j/ s3.leventhal.html. 12. Alejandro Montes García, Paul De Bra, George H. L. Fletcher, and Mykola Pech- enizkiy. A DSL Based on CSS for Hypertext Adaptation. In Leo Ferres, Gus- tavo Rossi, Virgilio Almeida, and Eelco Herder, editors, Proceedings of the 25th Conference on Hypertext and Social Media (HT), pages 313–315. ACM, 2014. doi:10.1145/2631775.2631782. 13. Pierre Genevès, Nabil Layaïda, and Vincent Quint. On the Analysis of Cascading Style Sheets. In Alain Mille, Fabien L. Gandon, Jacques Misselis, Michael Rabi- novich, and Steffen Staab, editors, Proceedings of the 21st World Wide Web Con- ference (WWW), pages 809–818. ACM, 2012. doi:10.1145/2187836.2187946. 14. Karl Gyllstrom, Carsten Eickhoff, Arjen P. de Vries, and Marie-Francine Moens. The Downside of Markup: Examining the Harmful Effects of CSS and Javascript on Indexing Today’s Web. In Proceedings of the 21st ACM International Conference on Conference on Information and Knowledge Management (CIKM), pages 1990– 1994. ACM, 2012. doi:10.1145/2396761.2398558. 15. Matthew Hague, Anthony Widjaja Lin, and C.-H. Luke Ong. Detecting Redundant CSS Rules in HTML5 Applications: a Tree Rewriting Approach. In Proceedings of the 30th Conference on Object-Oriented Programming, Systems, Languages and Ap- plications (OOPSLA), pages 1–19. ACM, 2015. doi:10.1145/2814270.2814288. 16. Simon Harper, Sean Bechhofer, and Darren Lunn. SADIe: Transcoding based on CSS. In Simeon Keates and Simon Harper, editors, Proceedings of the Eighth International ACM SIGACCESS Conference on Computers and Accessibility (AS- SETS), pages 259–260. ACM, 2006. doi:10.1145/1168987.1169044. 17. Misko Hevery and Adam Abrons. Declarative Web-Applications without Server: Demonstration of How a Fully Functional Web-Application Can Be Built in an Hour with only HTML, CSS & Javascript Library. In Shail Arora and Gary T. Leavens, editors, Companion to the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 801–802. ACM, 2009. doi:10.1145/1639950.1640022. 18. Lin-Shung Huang, Zack Weinberg, Chris Evans, and Collin Jackson. Protecting Browsers from Cross-origin CSS Attacks. In Ehab Al-Shaer, Angelos D. Keromytis, and Vitaly Shmatikov, editors, Proceedings of the 17th Conference on Computer and Communications Security (CCS), pages 619–629. ACM, 2010. doi:10.1145/ 1866307.1866376. 19. Richard Duchatsch Johansen, Talita Cristina Pagani Britto, and Cesar Augusto Cusin. CSS Browser Selector Plus: A JavaScript Library to Support Cross-browser Responsive Design. In Leslie Carr, Alberto H. F. Laender, Bernadette Farias Lós- cio, Irwin King, Marcus Fontoura, Denny Vrandecic, Lora Aroyo, José Palazzo M. de Oliveira, Fernanda Lima, and Erik Wilde, editors, Companion Volume of the 22nd International World Wide Web Conference (WWW), pages 27–30. ACM, 2013. 20. Matthias Keller and Martin Nussbaumer. Cascading Style Sheets: A Novel Ap- proach Towards Productive Styling With Today’s Standards. In Juan Quemada, Gonzalo León, Yoëlle S. Maarek, and Wolfgang Nejdl, editors, Proceedings of the 18th International Conference on World Wide Web (WWW), pages 1161–1162. ACM, 2009. doi:10.1145/1526709.1526907. 21. Matthias Keller and Martin Nussbaumer. CSS Code Quality: A Metric for Ab- stractness; Or Why Humans Beat Machines in CSS Coding. In Fernando Brito e Abreu, João Pascoal Faria, and Ricardo Jorge Machado, editors, Proceedings of the Seventh International Conference on the Quality of Information and Commu- nications Technology (QUATIC), pages 116–121. IEEE Computer Society, 2010. doi:10.1109/QUATIC.2010.25. 22. Jukka K. Korpela. Lurching Toward Babel: HTML, CSS, and XML. IEEE Com- puter, 31(7):103–104, 1998. doi:10.1109/2.689682. 23. Robert Kotcher, Yutong Pei, Pranjal Jumde, and Collin Jackson. Cross-origin Pixel Stealing: Timing Attacks Using CSS Filters. In Ahmad-Reza Sadeghi, Vir- gil D. Gligor, and Moti Yung, editors, Proceedings of the SIGSAC Conference on Computer and Communications Security (CCS), pages 1055–1062. ACM, 2013. doi:10.1145/2508859.2516712. 24. H.-S. Liang, K.-H. Kuo, P.-W. Lee, Y.-C. Chan, Y.-C. Lin, and M. Y. Chen. SeeSS: Seeing What I Broke — Visualizing Change Impact of Cascading Style Sheets. In Proceedings of the 26th annual ACM symposium on User Interface Software and Technology (UIST), pages 353–356, 2013. 25. Håkon Wium Lie and Janne Saarela. Multipurpose Web Publishing Using HTML, XML, and CSS. Communications of the ACM, 42(10):95–101, 1999. doi:10.1145/ 317665.317681. 26. Jakub Marszalkowski, Jan Mizgajski, Dariusz Mokwa, and Maciej Drozdowski. Analysis and Solution of CSS-Sprite Packing Problem. ACM Transactions on the Web, 10(1):1, 2016. doi:10.1145/2818377. 27. Davood Mazinanian and Nikolaos Tsantalis. An Empirical Study on the Use of CSS Preprocessors. In Proceedings of the 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), pages 168–178. IEEE Computer Society, 2016. doi:10.1109/SANER.2016.18. 28. Davood Mazinanian, Nikolaos Tsantalis, and Ali Mesbah. Discovering Refactoring Opportunities in Cascading Style Sheets. In Proceedings of the 22nd Symposium on the Foundations of Software Engineering (FSE), pages 496–506. ACM, 2014. doi:10.1145/2635868.2635879. 29. Ali Mesbah and Shabnam Mirshokraie. Automated Analysis of CSS Rules to Support Style Maintenance. In Martin Glinz, Gail C. Murphy, and Mauro Pezzè, editors, Proceedings of the 34th International Conference on Software Engineering (ICSE), pages 408–418. IEEE, 2012. doi:10.1109/ICSE.2012.6227174. 30. Thomas H. Park, Brian Dorn, and Andrea Forte. An Analysis of HTML and CSS Syntax Errors in a Web Development Course. ACM Transactions on Computing Education (TOCE), 15(1):4, 2015. doi:10.1145/2700514. 31. Thomas H. Park, Ankur Saxena, Swathi Jagannath, Susan Wiedenbeck, and An- drea Forte. Towards a Taxonomy of Errors in HTML and CSS. In Beth Simon, Alison Clear, and Quintin I. Cutts, editors, Proceedings of the Ninth Interna- tional Computing Education Research Conference (ICER), pages 75–82. ACM, 2013. doi:10.1145/2493394.2493405. 32. Mikko Pohja and Petri Vuorimaa. CSS Layout Engine for Compound Documents. In Proceedings of the Third Latin American Web Congress (LA-Web), pages 148– 156. IEEE Computer Society, 2005. doi:10.1109/LAWEB.2005.13. 33. Hafez Rouzati, Luis Cruiz, and Blair MacIntyre. Unified WebGL/CSS Scene- graph and Application to AR. In Jorge Posada, Donald P. Brutzman, De- nis Gracanin, Byounghyun Yoo, and David Oyarzun, editors, Proceedings of the 18th International Conference on Web3D Technology, page 210. ACM, 2013. doi:10.1145/2466533.2466568. 34. Adrian Sampson, Calin Cascaval, Luis Ceze, Pablo Montesinos, and Darío Suárez Gracia. Automatic Discovery of Performance and Energy Pitfalls in HTML and CSS. In Proceedings of the International Symposium on Workload Characterization (IISWC), pages 82–83. IEEE Computer Society, 2012. doi:10.1109/IISWC.2012. 6402904. 35. Manuel Serrano. HSS: a Compiler for Cascading Style Sheets. In Proceedings of the 12th International Conference on Principles and Practice of Declarative Pro- gramming (PPP), pages 109–118. ACM, 2010. doi:10.1145/1836089.1836103. 36. Dave Shea. CSS Zen Garden. In Simon Allardice, editor, Proceedings of the 31st International Conference on Computer Graphics and Interactive Techniques (SIG- GRAPH), Web Graphics, page 18. ACM, 2004. doi:10.1145/1186194.1186219. 37. Henrik Stormer. Personalized Websites for Mobile Devices using Dynamic Cascad- ing Style Sheets. IJWIS, 1(2):83–88, 2005. doi:10.1108/17440080580000085. 38. Jan Sutter, Kristian Sons, and Philipp Slusallek. A CSS Integration Model for Declarative 3D. In Jinyuan Jia, Felix G. Hamza-Lup, and Tobias Schreck, editors, Proceedings of the 20th International Conference on 3D Web Technology (Web3D), pages 209–217. ACM, 2015. doi:10.1145/2775292.2775295. 39. Naoki Takei, Takamichi Saito, Ko Takasu, and Tomotaka Yamada. Web Browser Fingerprinting Using Only Cascading Style Sheets. In Leonard Barolli, Fatos Xhafa, Marek R. Ogiela, and Lidia Ogiela, editors, Proceedings of the 10th International Conference on Broadband and Wireless Computing, Communica- tion and Applications (BWCCA), pages 57–63. IEEE Computer Society, 2015. doi:10.1109/BWCCA.2015.105. 40. Da-Chun Wu and Hsiu-Yang Su. Information Hiding in EPUB Files by Rearrang- ing the Contents of CSS Files. In Kebin Jia, Jeng-Shyang Pan, Yao Zhao, and Lakhmi C. Jain, editors, Proceedings of the Ninth International Conference on In- telligent Information Hiding and Multimedia Signal Processing (IIH-MSP), pages 80–83. IEEE, 2013. doi:10.1109/IIH-MSP.2013.29. 41. Jesia Zakraoui and Wolfgang L. Zagler. A Method for Generating CSS to Im- prove Web Accessibility for Old Users. In Klaus Miesenberger, Arthur I. Karsh- mer, Petr Penáz, and Wolfgang L. Zagler, editors, Proceedings of the 13th In- ternational Conference on Computers Helping People with Special Needs (IC- CHP), Part I, volume 7382 of LNCS, pages 329–336. Springer, 2012. doi: 10.1007/978-3-642-31522-0_50. Appendix D. Abstract Object-oriented Syntax

This appendix describes the abstract syntax of the designed domain-specific language. An overview of the abstract syntax will be followed by detailed views of each of the subclasses.

ConventionSet represents a style guide. It comprises a number of conventions that form coherent guidelines. Attribute contexts is a list of Contexts that contains contexts. Context represents a group of conventions that belong to the same semantic group (e.g. whitespacing, syntax preference, programming style). Attribute conventions is a list of Conventions that contains conventions. Attribute ignored_patterns is a list of Patterns that are ignored while searching for the target pattern. For example, while searching for violations of semantic conventions, the whitespacing and indentation nodes are ignored. Convention represents a rule that enforces specific constraints. Attribute pat- tern is the pattern that the convention targets. Attribute description is the description of the convention in natural text. This description is displayed to the user when a violation of the convention is discovered. PatternDescriptor represents a description of a node or a combination of related nodes that a given convention constraints. Attribute root is the top node described in the pattern. Attribute nodes is a collection of all nodes described by the pattern. Attribute relations is a collection of relationships between the nodes used in the pattern. NodeRelation represents a relation between two Nodes. Attribute tar- get_node designates a description of the Node targeted by the relation. NodeDescriptor is an abstract class that contains a description of a Css Node. Attribute constraint is an expression that designates the constraints applied to the node. Node represents a description of a node used in a PatternDescriptor. Attribute constraint is an expression that designates constraints applied to the node. Attribute identifier is a given string that can be used as a reference to the matched node. WhitespaceNode represents a description of a whitespace node that refer- ences space, newline, indentation symbols. Attribute constraint is an ex- pression that designates constraints applied to the node. Attribute repeater is an optional constraint that specifies the number of times a whitespace node can appear consecutively. Repeaters are useful to express conventions that do not specify exact quantities of whitespace symbols. For example, the convention “put at least one blank line between rules” sets a lower limit of the number of blank lines, but not an upper limit.

Now a detailed view of the expressions in the abstract syntax of CssCoco will be followed by a description of the subclasses of Expression:

LiteralExpr represents an expression containing a literal value. Attribute value is the value of the literal expression. VariableExpr represents a reference to a matched node. Attribute name is the identifier used to reference the node. UnaryExpr represents expressions with a single operand. Attribute operand is operand of the expression. NotExpr represents negation expression. UnaryMinusExpr represents unary minus expression. UnaryPlusExpr represents unary plus expression. BinaryExpr represents expressions with two operands. Attributes left and right represent the first and second operands, respectively. OrExpr represents disjunction expression. AndExpr represents conjunction expression. ComparisonExpr represents expression that compares two operands. IsExpr represents expression that checks whether the first operand is of the given type, specified by the second operand. InExpr represents expression that checks whether the first operand is present in a list of values, specified by the second operand. MatchExpr represents expression that checks whether the first operand matches a regular expression, specified by the second operand. CallExpr represents expression that invokes a API property or method of the operand. Attribute operand is the operand of the expression. Attribute value is the name of the API property or method that is invoked. NodeQueryExpr represents expression that queries node context. Attribute operand is the node used as a reference point for the query.

The next diagram presents a detailed view of the literal expressions used in the abstract syntax of CssCoco, followed by a listing of the classes.

IntegerExpr represents expression containing an integer value. DecimalExpr represents expression containing a decimal value. StringExpr represents expression containing a string value. BooleanExpr represents expression containing a boolean value. NodeTypeExpr represents expression containing a string value that describes a node type. ListExpr represents expression containing a list value. The elements of the list are of type LiteralExpr.

In the same way we present the call expressions used in the abstract syntax of CssCoco, followed by a listing of the classes. PropertyExpr represents an expression that returns the value of a property of the operand node. Attribute operand represents the node targeted by the expression. Attribute value holds the name of the property that is accessed. MethodExpr represents an expression that invokes a method of the operand node. Attribute argument represents the argument passed to the invoked method.

Lastly, node query expressions:

NextSiblingExpr represents expression that returns the following sibling of the operand node. PreviousSiblingExpr represents expression that returns the previous sibling of the operand node. NodeQueryWithArgExpr represents expression that queries node context and uses additional constraints for the query. Attribute argument represents the additional constraints used by the query. ContainsExpr represents an expression that checks whether the operand node contains a node that matches given constraints. ContainsAllExpr represents an expression that checks whether the operand node contains nodes that match given constraints. CountExpr represents an expression that counts the number of ancestor nodes of the operand that match a given constraint. BeforeExpr represents an expression that checks whether a given pattern of nodes appears before the operand node. AfterExpr represents an expression that checks whether a given pattern of nodes appears after the operand node. BetweenExpr represents an expression that checks whether a given pattern of nodes appears between the two operand nodes. Appendix E. Concrete Textual Syntax

This appendix contains the concrete syntax of the designed DSL. Below are presented the grammar rules accompanied by the mapping to the abstract syntax of the language. stylesheet represents a style guide. Abstract Syntax Mapping: ast.ConventionSet. stylesheet : context* ; context represents a group of logically related conventions. A single style guide can comprise a number of conventions that enforce various constraints, e.g. whitespacing, syntax preference, program style. Contexts group conventions that ignore the same nodes while searching for their violations. Abstract Syntax Mapping: ast.Context. context : Identifier ignore_clause? '{' convention* '}' ; ignore_clause : 'ignore' (node_descriptor)+ (',' (node_descriptor)+)* ; convention represents a single rule in the style guide. Conventions are typically expressed by directly stating what is disallowed or describing a condition that if met, requires additional constraints. The former way of expressing conventions is represented by the forbid conventions. The latter approach uses the structure find ... require .... To break down complex disallowing conventions, the structure find ... forbid ... has been introduced. This aims at improving readability of conventions. Additionally, conventions have a where clause which applies constraints for matching nodes. It is used to expression matching con- straints that span over multiple nodes and therefore cannot be present in the node descriptors. Abstract Syntax Mapping: ast.Convention. convention : 'forbid' pattern ('where' logic_expr)? 'message' String | 'find' pattern ('where' logic_expr)? ('require'|'forbid') logic_expr 'message' String ; pattern represents a pattern of nodes and their relations. For example, it can describe a horizontal sequence of sibling nodes, a vertical pattern of nested nodes, or pairs of elements with a common parent. Abstract Syntax Mapping: ast.PatternDescriptor. pattern : node_declaration (('in'|'next-to') node_declaration)* | fork ('in' node_declaration)* ; fork : '(' node_declaration (',' node_declaration)+ ')' ; node_declaration : (Identifier '=')? semantic_node ; node_descriptor represents a description of a node. It specifies the type of the node and its additional constraints. Abstract Syntax Mapping: ast.NodeDescriptor. node_descriptor : 'unique'? node_type ('{' (logic_expr|repeater) '}')? ; repeater : Integer ',' Integer? | (',')? Integer ; logic_expr represents expressions that perform logic operations and glue arithmetic and type expressions. Abstract Syntax Mapping: ast.NotExpr, ast.AndExpr, ast.OrExpr and all arithmetic_expression and type_expression mappings. logic_expr : '(' logic_expr ')' | 'not' logic_expr | logic_expr 'and' logic_expr | logic_expr 'or' logic_expr | type_expr | arithmetic_expr ; type_expr represents expressions that ensure node type and perform node queries on nodes. They are located in a separate parser rule because they inter- pret Identifiers as node type expressions instead of a API calls. Abstract Syntax Mapping: ast.IsExpr, ast.BeforeExpr, ast.AfterExpr, ast.BetweenExpr. type_expr : arithmetic_expr operator='is' Identifier | node_descriptor+ ('before' | 'after') type_operand | node_descriptor+ 'between' type_operand 'and' type_operand ; type_operand : Identifier | semantic_node ; arithmetic_expr represents arithmetic, comparison, set membership and regex expressions. These are located in a separate parser rule because they interpret identifiers as API calls instead of node type expressions. Abstract Syntax Mapping: ast.UnaryMinus, ast.UnaryPlus, ast.LessThan, ast.LessThanOrEq, ast.GreaterThan, ast.GreaterThanOrEq, ast.Equal, ast.NotEqual, ast.InExpr, ast.MatchExpr, ast.LiteralExpr. arithmetic_expr : ('-'|'+') arithmetic_expr | arithmetic_expr ('<'|'>'|'<='|'>='|'=='|'!=') arithmetic_expr | arithmetic_expr ('in'|'not in'|'match'|'not match') arithmetic_expr | call_expression | element ; element : Boolean | Decimal | Integer | String | list_ ; call_expression represents an API call expression and also node query expres- sion. Abstract Syntax Mapping: ast.CallExpr and ast.NodeQueryExpr. call_expression : call_expression '.' call_expression | Identifier ('(' (element | semantic_node ) ')')? ; Boolean: represents Boolean literal expression. Abstract Syntax Mapping: ast.BooleanExpr. Boolean : 'true' | 'True' | 'false' | 'False' ; String: represents String literal expression. Abstract Syntax Mapping: ast.StringExpr. String : "'" (EscapeSequence | ~['])*? "'" ; EscapeSequence : "\\" "'" ; Integer: represents Integer literal expression. Abstract Syntax Mapping: ast.IntegerExpr. Integer : (ZeroDigit | NonZeroDigit Digit*) ; Digit : ZeroDigit | NonZeroDigit ; NonZeroDigit : [1-9] ; ZeroDigit : [0] ; Decimal: represents Decimal literal expression. Abstract Syntax Mapping: ast.DecimalExpr. Decimal : ( NonZeroDigit Digit* | ZeroDigit? ) '.' Digit+ ; Digit : ZeroDigit | NonZeroDigit ; NonZeroDigit : [1-9] ; ZeroDigit : [0] ; list and list_element represent the List literal expression. Abstract Syntax Mapping: ast.ListExpr. list_ : '[' list_element (',' list_element)* ']' ; list_element : Integer | Decimal | String | semantic_node ; Letter : [a-zA-Z] ; Identifier : (Letter)(Letter|Digit|'_'|'-')* ; type_expression represents the NodeType literal expression. Abstract Syntax Mapping: ast.NodeType. node_type : '(' node_type ')' | 'not' node_type | node_type 'and' node_type | node_type 'or' node_type | Identifier ; Appendix F. CssCoco Plugin

– http://github.com/boryanagoncharenko/CssCoco – http://github.com/boryanagoncharenko/Sublime-CssCoco – https://pypi.python.org/pypi?:action=display&name=csscoco