From 20e87d6309eb7a1cc6c876a283fdddd4f0afc486 Mon Sep 17 00:00:00 2001 From: Andrew Savage Date: Wed, 18 May 2022 15:05:50 -0700 Subject: [PATCH] Delete unused IDL scripts b/154137263 Change-Id: I46f0bfe3930c2d9a4674873b4dd38c553105b555 --- tools/idl_parser/idl_lexer_test.py | 103 ---- tools/idl_parser/idl_parser_test.py | 107 ----- tools/idl_parser/idl_ppapi_lexer.py | 71 --- tools/idl_parser/idl_ppapi_parser.py | 329 ------------- tools/idl_parser/run_tests.py | 22 - tools/idl_parser/test_lexer/keywords.in | 52 --- tools/idl_parser/test_lexer/keywords_ppapi.in | 44 -- tools/idl_parser/test_lexer/values.in | 55 --- tools/idl_parser/test_lexer/values_ppapi.in | 50 -- tools/idl_parser/test_parser/callback_web.idl | 116 ----- .../idl_parser/test_parser/dictionary_web.idl | 118 ----- tools/idl_parser/test_parser/enum_ppapi.idl | 126 ----- tools/idl_parser/test_parser/enum_web.idl | 123 ----- .../idl_parser/test_parser/exception_web.idl | 87 ---- .../idl_parser/test_parser/extattr_ppapi.idl | 99 ---- .../idl_parser/test_parser/implements_web.idl | 52 --- tools/idl_parser/test_parser/inline_ppapi.idl | 46 -- .../idl_parser/test_parser/interface_web.idl | 442 ------------------ tools/idl_parser/test_parser/label_ppapi.idl | 48 -- tools/idl_parser/test_parser/struct_ppapi.idl | 56 --- .../idl_parser/test_parser/typedef_ppapi.idl | 92 ---- tools/idl_parser/test_parser/typedef_web.idl | 206 -------- 22 files changed, 2444 deletions(-) delete mode 100755 tools/idl_parser/idl_lexer_test.py delete mode 100755 tools/idl_parser/idl_parser_test.py delete mode 100755 tools/idl_parser/idl_ppapi_lexer.py delete mode 100755 tools/idl_parser/idl_ppapi_parser.py delete mode 100755 tools/idl_parser/run_tests.py delete mode 100644 tools/idl_parser/test_lexer/keywords.in delete mode 100644 tools/idl_parser/test_lexer/keywords_ppapi.in delete mode 100644 tools/idl_parser/test_lexer/values.in delete mode 100644 tools/idl_parser/test_lexer/values_ppapi.in delete mode 100644 tools/idl_parser/test_parser/callback_web.idl delete mode 100644 tools/idl_parser/test_parser/dictionary_web.idl delete mode 100644 tools/idl_parser/test_parser/enum_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/enum_web.idl delete mode 100644 tools/idl_parser/test_parser/exception_web.idl delete mode 100644 tools/idl_parser/test_parser/extattr_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/implements_web.idl delete mode 100644 tools/idl_parser/test_parser/inline_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/interface_web.idl delete mode 100644 tools/idl_parser/test_parser/label_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/struct_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/typedef_ppapi.idl delete mode 100644 tools/idl_parser/test_parser/typedef_web.idl diff --git a/tools/idl_parser/idl_lexer_test.py b/tools/idl_parser/idl_lexer_test.py deleted file mode 100755 index f8d8bb9a26c5..000000000000 --- a/tools/idl_parser/idl_lexer_test.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os -import unittest - -from idl_lexer import IDLLexer -from idl_ppapi_lexer import IDLPPAPILexer - - -# -# FileToTokens -# -# From a source file generate a list of tokens. -# -def FileToTokens(lexer, filename): - with open(filename, 'rb') as srcfile: - lexer.Tokenize(srcfile.read(), filename) - return lexer.GetTokens() - - -# -# TextToTokens -# -# From a source file generate a list of tokens. -# -def TextToTokens(lexer, text): - lexer.Tokenize(text) - return lexer.GetTokens() - - -class WebIDLLexer(unittest.TestCase): - def setUp(self): - self.lexer = IDLLexer() - cur_dir = os.path.dirname(os.path.realpath(__file__)) - self.filenames = [ - os.path.join(cur_dir, 'test_lexer/values.in'), - os.path.join(cur_dir, 'test_lexer/keywords.in') - ] - - # - # testRebuildText - # - # From a set of tokens, generate a new source text by joining with a - # single space. The new source is then tokenized and compared against the - # old set. - # - def testRebuildText(self): - for filename in self.filenames: - tokens1 = FileToTokens(self.lexer, filename) - to_text = '\n'.join(['%s' % t.value for t in tokens1]) - tokens2 = TextToTokens(self.lexer, to_text) - - count1 = len(tokens1) - count2 = len(tokens2) - self.assertEqual(count1, count2) - - for i in range(count1): - msg = 'Value %s does not match original %s on line %d of %s.' % ( - tokens2[i].value, tokens1[i].value, tokens1[i].lineno, filename) - self.assertEqual(tokens1[i].value, tokens2[i].value, msg) - - # - # testExpectedType - # - # From a set of tokens pairs, verify the type field of the second matches - # the value of the first, so that: - # integer 123 float 1.1 ... - # will generate a passing test, when the first token has both the type and - # value of the keyword integer and the second has the type of integer and - # value of 123 and so on. - # - def testExpectedType(self): - for filename in self.filenames: - tokens = FileToTokens(self.lexer, filename) - count = len(tokens) - self.assertTrue(count > 0) - self.assertFalse(count & 1) - - index = 0 - while index < count: - expect_type = tokens[index].value - actual_type = tokens[index + 1].type - msg = 'Type %s does not match expected %s on line %d of %s.' % ( - actual_type, expect_type, tokens[index].lineno, filename) - index += 2 - self.assertEqual(expect_type, actual_type, msg) - - -class PepperIDLLexer(WebIDLLexer): - def setUp(self): - self.lexer = IDLPPAPILexer() - cur_dir = os.path.dirname(os.path.realpath(__file__)) - self.filenames = [ - os.path.join(cur_dir, 'test_lexer/values_ppapi.in'), - os.path.join(cur_dir, 'test_lexer/keywords_ppapi.in') - ] - - -if __name__ == '__main__': - unittest.main() diff --git a/tools/idl_parser/idl_parser_test.py b/tools/idl_parser/idl_parser_test.py deleted file mode 100755 index 135a394199f1..000000000000 --- a/tools/idl_parser/idl_parser_test.py +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import glob -import unittest - -from idl_lexer import IDLLexer -from idl_parser import IDLParser, ParseFile -from idl_ppapi_lexer import IDLPPAPILexer -from idl_ppapi_parser import IDLPPAPIParser - -def ParseCommentTest(comment): - comment = comment.strip() - comments = comment.split(None, 1) - return comments[0], comments[1] - - -class WebIDLParser(unittest.TestCase): - def setUp(self): - self.parser = IDLParser(IDLLexer(), mute_error=True) - self.filenames = glob.glob('test_parser/*_web.idl') - - def _TestNode(self, node): - comments = node.GetListOf('Comment') - for comment in comments: - check, value = ParseCommentTest(comment.GetName()) - if check == 'BUILD': - msg = 'Expecting %s, but found %s.\n' % (value, str(node)) - self.assertEqual(value, str(node), msg) - - if check == 'ERROR': - msg = node.GetLogLine('Expecting\n\t%s\nbut found \n\t%s\n' % ( - value, str(node))) - self.assertEqual(value, node.GetName(), msg) - - if check == 'PROP': - key, expect = value.split('=') - actual = str(node.GetProperty(key)) - msg = 'Mismatched property %s: %s vs %s.\n' % (key, expect, actual) - self.assertEqual(expect, actual, msg) - - if check == 'TREE': - quick = '\n'.join(node.Tree()) - lineno = node.GetProperty('LINENO') - msg = 'Mismatched tree at line %d:\n%sVS\n%s' % (lineno, value, quick) - self.assertEqual(value, quick, msg) - - @unittest.skip("failing ") - def testExpectedNodes(self): - for filename in self.filenames: - filenode = ParseFile(self.parser, filename) - children = filenode.GetChildren() - self.assertTrue(len(children) > 2, 'Expecting children in %s.' % - filename) - - for node in filenode.GetChildren()[2:]: - self._TestNode(node) - -@unittest.skip("Not supported in Cobalt") -class PepperIDLParser(unittest.TestCase): - def setUp(self): - self.parser = IDLPPAPIParser(IDLPPAPILexer(), mute_error=True) - self.filenames = glob.glob('test_parser/*_ppapi.idl') - - def _TestNode(self, filename, node): - comments = node.GetListOf('Comment') - for comment in comments: - check, value = ParseCommentTest(comment.GetName()) - if check == 'BUILD': - msg = '%s - Expecting %s, but found %s.\n' % ( - filename, value, str(node)) - self.assertEqual(value, str(node), msg) - - if check == 'ERROR': - msg = node.GetLogLine('%s - Expecting\n\t%s\nbut found \n\t%s\n' % ( - filename, value, str(node))) - self.assertEqual(value, node.GetName(), msg) - - if check == 'PROP': - key, expect = value.split('=') - actual = str(node.GetProperty(key)) - msg = '%s - Mismatched property %s: %s vs %s.\n' % ( - filename, key, expect, actual) - self.assertEqual(expect, actual, msg) - - if check == 'TREE': - quick = '\n'.join(node.Tree()) - lineno = node.GetProperty('LINENO') - msg = '%s - Mismatched tree at line %d:\n%sVS\n%s' % ( - filename, lineno, value, quick) - self.assertEqual(value, quick, msg) - - def testExpectedNodes(self): - for filename in self.filenames: - filenode = ParseFile(self.parser, filename) - children = filenode.GetChildren() - self.assertTrue(len(children) > 2, 'Expecting children in %s.' % - filename) - - for node in filenode.GetChildren()[2:]: - self._TestNode(filename, node) - -if __name__ == '__main__': - unittest.main(verbosity=2) - diff --git a/tools/idl_parser/idl_ppapi_lexer.py b/tools/idl_parser/idl_ppapi_lexer.py deleted file mode 100755 index a13c4e4ac955..000000000000 --- a/tools/idl_parser/idl_ppapi_lexer.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Lexer for PPAPI IDL - -The lexer uses the PLY library to build a tokenizer which understands both -WebIDL and Pepper tokens. - -WebIDL, and WebIDL regular expressions can be found at: - http://heycam.github.io/webidl/ -PLY can be found at: - http://www.dabeaz.com/ply/ -""" - -from idl_lexer import IDLLexer - - -# -# IDL PPAPI Lexer -# -class IDLPPAPILexer(IDLLexer): - # Token definitions - # - # These need to be methods for lexer construction, despite not using self. - # pylint: disable=R0201 - - # Special multi-character operators - def t_LSHIFT(self, t): - r'<<' - return t - - def t_RSHIFT(self, t): - r'>>' - return t - - def t_INLINE(self, t): - r'\#inline (.|\n)*?\#endinl.*' - self.AddLines(t.value.count('\n')) - return t - - # Return a "preprocessor" inline block - def __init__(self): - IDLLexer.__init__(self) - self._AddTokens(['INLINE', 'LSHIFT', 'RSHIFT']) - self._AddKeywords(['label', 'struct']) - - # Add number types - self._AddKeywords(['char', 'int8_t', 'int16_t', 'int32_t', 'int64_t']) - self._AddKeywords(['uint8_t', 'uint16_t', 'uint32_t', 'uint64_t']) - self._AddKeywords(['double_t', 'float_t']) - - # Add handle types - self._AddKeywords(['handle_t', 'PP_FileHandle']) - - # Add pointer types (void*, char*, const char*, const void*) - self._AddKeywords(['mem_t', 'str_t', 'cstr_t', 'interface_t']) - - # Remove JS types - self._DelKeywords(['boolean', 'byte', 'ByteString', 'Date', 'DOMString', - 'double', 'float', 'long', 'object', 'octet', 'Promise', - 'record', 'RegExp', 'short', 'unsigned', 'USVString']) - - -# If run by itself, attempt to build the lexer -if __name__ == '__main__': - lexer = IDLPPAPILexer() - lexer.Tokenize(open('test_parser/inline_ppapi.idl').read()) - for tok in lexer.GetTokens(): - print '\n' + str(tok) diff --git a/tools/idl_parser/idl_ppapi_parser.py b/tools/idl_parser/idl_ppapi_parser.py deleted file mode 100755 index 2556ffb47a69..000000000000 --- a/tools/idl_parser/idl_ppapi_parser.py +++ /dev/null @@ -1,329 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" Parser for PPAPI IDL """ - -# -# IDL Parser -# -# The parser is uses the PLY yacc library to build a set of parsing rules based -# on WebIDL. -# -# WebIDL, and WebIDL grammar can be found at: -# http://heycam.github.io/webidl/ -# PLY can be found at: -# http://www.dabeaz.com/ply/ -# -# The parser generates a tree by recursively matching sets of items against -# defined patterns. When a match is made, that set of items is reduced -# to a new item. The new item can provide a match for parent patterns. -# In this way an AST is built (reduced) depth first. -# - -# -# Disable check for line length and Member as Function due to how grammar rules -# are defined with PLY -# -# pylint: disable=R0201 -# pylint: disable=C0301 - -import sys - -from idl_ppapi_lexer import IDLPPAPILexer -from idl_parser import IDLParser, ListFromConcat, ParseFile -from idl_node import IDLNode - -class IDLPPAPIParser(IDLParser): -# -# We force all input files to start with two comments. The first comment is a -# Copyright notice followed by a file comment and finally by file level -# productions. -# - # [0] Insert a TOP definition for Copyright and Comments - def p_Top(self, p): - """Top : COMMENT COMMENT Definitions""" - Copyright = self.BuildComment('Copyright', p, 1) - Filedoc = self.BuildComment('Comment', p, 2) - p[0] = ListFromConcat(Copyright, Filedoc, p[3]) - -# -#The parser is based on the WebIDL standard. See: -# http://heycam.github.io/webidl/#idl-grammar -# - # [1] - def p_Definitions(self, p): - """Definitions : ExtendedAttributeList Definition Definitions - | """ - if len(p) > 1: - p[2].AddChildren(p[1]) - p[0] = ListFromConcat(p[2], p[3]) - - # [2] Add INLINE definition - def p_Definition(self, p): - """Definition : CallbackOrInterface - | Struct - | Partial - | Dictionary - | Exception - | Enum - | Typedef - | ImplementsStatement - | Label - | Inline""" - p[0] = p[1] - - def p_Inline(self, p): - """Inline : INLINE""" - words = p[1].split() - name = self.BuildAttribute('NAME', words[1]) - lines = p[1].split('\n') - value = self.BuildAttribute('VALUE', '\n'.join(lines[1:-1]) + '\n') - children = ListFromConcat(name, value) - p[0] = self.BuildProduction('Inline', p, 1, children) - -# -# Label -# -# A label is a special kind of enumeration which allows us to go from a -# set of version numbrs to releases -# - def p_Label(self, p): - """Label : LABEL identifier '{' LabelList '}' ';'""" - p[0] = self.BuildNamed('Label', p, 2, p[4]) - - def p_LabelList(self, p): - """LabelList : identifier '=' float LabelCont""" - val = self.BuildAttribute('VALUE', p[3]) - label = self.BuildNamed('LabelItem', p, 1, val) - p[0] = ListFromConcat(label, p[4]) - - def p_LabelCont(self, p): - """LabelCont : ',' LabelList - |""" - if len(p) > 1: - p[0] = p[2] - - def p_LabelContError(self, p): - """LabelCont : error LabelCont""" - p[0] = p[2] - - # [5.1] Add "struct" style interface - def p_Struct(self, p): - """Struct : STRUCT identifier Inheritance '{' StructMembers '}' ';'""" - p[0] = self.BuildNamed('Struct', p, 2, ListFromConcat(p[3], p[5])) - - def p_StructMembers(self, p): - """StructMembers : StructMember StructMembers - |""" - if len(p) > 1: - p[0] = ListFromConcat(p[1], p[2]) - - def p_StructMember(self, p): - """StructMember : ExtendedAttributeList Type identifier ';'""" - p[0] = self.BuildNamed('Member', p, 3, ListFromConcat(p[1], p[2])) - - def p_Typedef(self, p): - """Typedef : TYPEDEF ExtendedAttributeListNoComments Type identifier ';'""" - p[0] = self.BuildNamed('Typedef', p, 4, ListFromConcat(p[2], p[3])) - - def p_TypedefFunc(self, p): - """Typedef : TYPEDEF ExtendedAttributeListNoComments ReturnType identifier '(' ArgumentList ')' ';'""" - args = self.BuildProduction('Arguments', p, 5, p[6]) - p[0] = self.BuildNamed('Callback', p, 4, ListFromConcat(p[2], p[3], args)) - - def p_ConstValue(self, p): - """ConstValue : integer - | integer LSHIFT integer - | integer RSHIFT integer""" - val = str(p[1]) - if len(p) > 2: - val = "%s %s %s" % (p[1], p[2], p[3]) - p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'integer'), - self.BuildAttribute('VALUE', val)) - - def p_ConstValueStr(self, p): - """ConstValue : string""" - p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'string'), - self.BuildAttribute('VALUE', p[1])) - - # Boolean & Float Literals area already BuildAttributes - def p_ConstValueLiteral(self, p): - """ConstValue : FloatLiteral - | BooleanLiteral """ - p[0] = p[1] - - def p_EnumValueList(self, p): - """EnumValueList : EnumValue EnumValues""" - p[0] = ListFromConcat(p[1], p[2]) - - def p_EnumValues(self, p): - """EnumValues : ',' EnumValue EnumValues - |""" - if len(p) > 1: - p[0] = ListFromConcat(p[2], p[3]) - - def p_EnumValue(self, p): - """EnumValue : ExtendedAttributeList identifier - | ExtendedAttributeList identifier '=' ConstValue""" - p[0] = self.BuildNamed('EnumItem', p, 2, p[1]) - if len(p) > 3: - p[0].AddChildren(p[4]) - - # Omit PromiseType, as it is a JS type. - def p_NonAnyType(self, p): - """NonAnyType : PrimitiveType TypeSuffix - | identifier TypeSuffix - | SEQUENCE '<' Type '>' Null""" - IDLParser.p_NonAnyType(self, p) - - def p_PrimitiveType(self, p): - """PrimitiveType : IntegerType - | UnsignedIntegerType - | FloatType - | HandleType - | PointerType""" - if type(p[1]) == str: - p[0] = self.BuildNamed('PrimitiveType', p, 1) - else: - p[0] = p[1] - - def p_PointerType(self, p): - """PointerType : STR_T - | MEM_T - | CSTR_T - | INTERFACE_T - | NULL""" - p[0] = p[1] - - def p_HandleType(self, p): - """HandleType : HANDLE_T - | PP_FILEHANDLE""" - p[0] = p[1] - - def p_FloatType(self, p): - """FloatType : FLOAT_T - | DOUBLE_T""" - p[0] = p[1] - - def p_UnsignedIntegerType(self, p): - """UnsignedIntegerType : UINT8_T - | UINT16_T - | UINT32_T - | UINT64_T""" - p[0] = p[1] - - - def p_IntegerType(self, p): - """IntegerType : CHAR - | INT8_T - | INT16_T - | INT32_T - | INT64_T""" - p[0] = p[1] - - # These targets are no longer used - def p_OptionalLong(self, p): - """ """ - pass - - def p_UnrestrictedFloatType(self, p): - """ """ - pass - - def p_null(self, p): - """ """ - pass - - def p_PromiseType(self, p): - """ """ - pass - - def p_EnumValueListComma(self, p): - """ """ - pass - - def p_EnumValueListString(self, p): - """ """ - pass - - def p_StringType(self, p): - """ """ - pass - - def p_RecordType(self, p): - """ """ - pass - - def p_RecordTypeError(self, p): - """ """ - pass - - # We only support: - # [ identifier ] - # [ identifier ( ArgumentList )] - # [ identifier ( ValueList )] - # [ identifier = identifier ] - # [ identifier = ( IdentifierList )] - # [ identifier = ConstValue ] - # [ identifier = identifier ( ArgumentList )] - # [51] map directly to 74-77 - # [52-54, 56] are unsupported - def p_ExtendedAttribute(self, p): - """ExtendedAttribute : ExtendedAttributeNoArgs - | ExtendedAttributeArgList - | ExtendedAttributeValList - | ExtendedAttributeIdent - | ExtendedAttributeIdentList - | ExtendedAttributeIdentConst - | ExtendedAttributeNamedArgList""" - p[0] = p[1] - - def p_ExtendedAttributeValList(self, p): - """ExtendedAttributeValList : identifier '(' ValueList ')'""" - arguments = self.BuildProduction('Values', p, 2, p[3]) - p[0] = self.BuildNamed('ExtAttribute', p, 1, arguments) - - def p_ValueList(self, p): - """ValueList : ConstValue ValueListCont""" - p[0] = ListFromConcat(p[1], p[2]) - - def p_ValueListCont(self, p): - """ValueListCont : ValueList - |""" - if len(p) > 1: - p[0] = p[1] - - def p_ExtendedAttributeIdentConst(self, p): - """ExtendedAttributeIdentConst : identifier '=' ConstValue""" - p[0] = self.BuildNamed('ExtAttribute', p, 1, p[3]) - - - def __init__(self, lexer, verbose=False, debug=False, mute_error=False): - IDLParser.__init__(self, lexer, verbose, debug, mute_error) - - -def main(argv): - nodes = [] - parser = IDLPPAPIParser(IDLPPAPILexer()) - errors = 0 - - for filename in argv: - filenode = ParseFile(parser, filename) - if filenode: - errors += filenode.GetProperty('ERRORS') - nodes.append(filenode) - - ast = IDLNode('AST', '__AST__', 0, 0, nodes) - - print '\n'.join(ast.Tree(accept_props=['PROD', 'TYPE', 'VALUE'])) - if errors: - print '\nFound %d errors.\n' % errors - - - return errors - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) diff --git a/tools/idl_parser/run_tests.py b/tools/idl_parser/run_tests.py deleted file mode 100755 index 878f17ed34ec..000000000000 --- a/tools/idl_parser/run_tests.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import glob -import os -import sys -import unittest - -if __name__ == '__main__': - suite = unittest.TestSuite() - cur_dir = os.path.dirname(os.path.realpath(__file__)) - for testname in glob.glob(os.path.join(cur_dir, '*_test.py')): - print 'Adding Test: ' + testname - module = __import__(os.path.basename(testname)[:-3]) - suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(module)) - result = unittest.TextTestRunner(verbosity=2).run(suite) - if result.wasSuccessful(): - sys.exit(0) - else: - sys.exit(1) diff --git a/tools/idl_parser/test_lexer/keywords.in b/tools/idl_parser/test_lexer/keywords.in deleted file mode 100644 index abca990e415f..000000000000 --- a/tools/idl_parser/test_lexer/keywords.in +++ /dev/null @@ -1,52 +0,0 @@ -ANY any -ATTRIBUTE attribute -BOOLEAN boolean -BYTESTRING ByteString -BYTE byte -CALLBACK callback -CONST const -CREATOR creator -DATE Date -DELETER deleter -DICTIONARY dictionary -DOMSTRING DOMString -DOUBLE double -ENUM enum -EXCEPTION exception -FALSE false -FLOAT float -GETTER getter -IMPLEMENTS implements -INFINITY Infinity -INHERIT inherit -INTERFACE interface -ITERABLE iterable -LEGACYCALLER legacycaller -LEGACYITERABLE legacyiterable -LONG long -MAPLIKE maplike -NAN Nan -NULL null -OBJECT object -OCTET octet -OPTIONAL optional -OR or -PARTIAL partial -PROMISE Promise -READONLY readonly -RECORD record -REGEXP RegExp -REQUIRED required -SEQUENCE sequence -SERIALIZER serializer -SETLIKE setlike -SETTER setter -SHORT short -STATIC static -STRINGIFIER stringifier -TYPEDEF typedef -TRUE true -UNSIGNED unsigned -UNRESTRICTED unrestricted -USVSTRING USVString -VOID void diff --git a/tools/idl_parser/test_lexer/keywords_ppapi.in b/tools/idl_parser/test_lexer/keywords_ppapi.in deleted file mode 100644 index 62567e4852c4..000000000000 --- a/tools/idl_parser/test_lexer/keywords_ppapi.in +++ /dev/null @@ -1,44 +0,0 @@ -ANY any -ATTRIBUTE attribute -CALLBACK callback -CONST const -CREATOR creator -DELETER deleter -DICTIONARY dictionary -FALSE false -EXCEPTION exception -GETTER getter -IMPLEMENTS implements -INFINITY Infinity -INTERFACE interface -LABEL label -LEGACYCALLER legacycaller -NAN Nan -NULL null -OPTIONAL optional -OR or -PARTIAL partial -READONLY readonly -SETTER setter -STATIC static -STRINGIFIER stringifier -TYPEDEF typedef -TRUE true -VOID void -CHAR char -INT8_T int8_t -INT16_T int16_t -INT32_T int32_t -INT64_T int64_t -UINT8_T uint8_t -UINT16_T uint16_t -UINT32_T uint32_t -UINT64_T uint64_t -DOUBLE_T double_t -FLOAT_T float_t -MEM_T mem_t -STR_T str_t -CSTR_T cstr_t -INTERFACE_T interface_t -HANDLE_T handle_t -PP_FILEHANDLE PP_FileHandle \ No newline at end of file diff --git a/tools/idl_parser/test_lexer/values.in b/tools/idl_parser/test_lexer/values.in deleted file mode 100644 index be714d081911..000000000000 --- a/tools/idl_parser/test_lexer/values.in +++ /dev/null @@ -1,55 +0,0 @@ -integer 1 integer 123 integer 12345 -identifier A123 identifier A_A - -COMMENT /*XXXX*/ -COMMENT //XXXX - -COMMENT /*MULTI LINE*/ - -[ [ -] ] -* * -. . -( ( -) ) -{ { -} } -[ [ -] ] -, , -; ; -: : -= = -+ + -- - -/ / -~ ~ -| | -& & -^ ^ -> > -< < - -ELLIPSIS ... - -float 1.1 -float 1e1 -float -1.1 -float -1e1 -float 1e-1 -float -1e-1 -float 1.0e1 -float -1.0e-1 - -integer 00 -integer 01 -integer 0123 -integer 01234567 -integer 123 -integer 1234567890 -integer 0x123 -integer 0X123 -integer 0x1234567890AbCdEf -integer 0X1234567890aBcDeF - -identifier blah diff --git a/tools/idl_parser/test_lexer/values_ppapi.in b/tools/idl_parser/test_lexer/values_ppapi.in deleted file mode 100644 index 33fa577202ce..000000000000 --- a/tools/idl_parser/test_lexer/values_ppapi.in +++ /dev/null @@ -1,50 +0,0 @@ -integer 1 integer 123 integer 12345 -identifier A123 identifier A_A - -COMMENT /*XXXX*/ -COMMENT //XXXX - -COMMENT /*MULTI LINE*/ - -[ [ -] ] -* * -. . -( ( -) ) -{ { -} } -[ [ -] ] -, , -; ; -: : -= = -+ + -- - -/ / -~ ~ -| | -& & -^ ^ -> > -< < - -LSHIFT << -RSHIFT >> -ELLIPSIS ... - -float 1.1 -float 1e1 -float -1.1 -float -1e1 -float 1e-1 -float -1e-1 -float 1.0e1 -float -1.0e-1 - -integer 00 -integer 01 -integer 0123 - -identifier blah diff --git a/tools/idl_parser/test_parser/callback_web.idl b/tools/idl_parser/test_parser/callback_web.idl deleted file mode 100644 index b16b6b5751e7..000000000000 --- a/tools/idl_parser/test_parser/callback_web.idl +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Callback productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Callback(VoidFunc) - * Type() - * PrimitiveType(void) - * Arguments() - */ -callback VoidFunc = void(); - -/* TREE - *Callback(VoidFuncLongErr) - * Type() - * PrimitiveType(void) - * Arguments() - * Error(Unexpected ).) - */ -callback VoidFuncLongErr = void ( long ); - -/* TREE - *Callback(VoidFuncLong) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(L1) - * Type() - * PrimitiveType(long) - */ -callback VoidFuncLong = void ( long L1 ); - -/* TREE - *Callback(VoidFuncLongArray) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(L1) - * Type() - * PrimitiveType(long) - * Array() - */ -callback VoidFuncLongArray = void ( long[] L1 ); - -/* TREE - *Callback(VoidFuncLongArray5) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(L1) - * Type() - * PrimitiveType(long) - * Array(5) - */ -callback VoidFuncLongArray5 = void ( long[5] L1 ); - - -/* TREE - *Callback(VoidFuncLongArray54) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(L1) - * Type() - * PrimitiveType(long) - * Array(5) - * Argument(L2) - * Type() - * PrimitiveType(long long) - * Array(4) - */ -callback VoidFuncLongArray54 = void ( long[5] L1, long long [4] L2 ); - - -/* TREE - *Callback(VoidFuncLongIdent) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(L1) - * Type() - * PrimitiveType(long) - * Array(5) - * Argument(L2) - * Type() - * Typeref(VoidFuncLongArray) - */ -callback VoidFuncLongIdent = void ( long[5] L1, VoidFuncLongArray L2 ); diff --git a/tools/idl_parser/test_parser/dictionary_web.idl b/tools/idl_parser/test_parser/dictionary_web.idl deleted file mode 100644 index 835124603418..000000000000 --- a/tools/idl_parser/test_parser/dictionary_web.idl +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Dictionary productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Dictionary(MyDict) - */ -dictionary MyDict { }; - -/* TREE - *Dictionary(MyDictInherit) - * Inherit(Foo) - */ -dictionary MyDictInherit : Foo {}; - -/* TREE - *Dictionary(MyDictPartial) - */ -partial dictionary MyDictPartial { }; - -/* ERROR Unexpected ":" after identifier "MyDictInherit". */ -partial dictionary MyDictInherit : Foo {}; - -/* TREE - *Dictionary(MyDictBig) - * Key(setString) - * Type() - * StringType(DOMString) - * Default(Foo) - * Key(setLong) - * Type() - * PrimitiveType(unsigned long long) - * Default(123) - * Key(unsetLong) - * Type() - * PrimitiveType(long) - */ -dictionary MyDictBig { - DOMString setString = "Foo"; - unsigned long long setLong = 123; - long unsetLong; -}; - -/* TREE - *Dictionary(MyDictRequired) - * Key(setLong) - * Type() - * PrimitiveType(long) - */ -dictionary MyDictRequired { - required long setLong; -}; - -/* ERROR Unexpected "{" after keyword "dictionary". */ -dictionary { - DOMString? setString = null; -}; - -/* TREE - *Dictionary(MyDictionaryInvalidOptional) - * Key(mandatory) - * Type() - * StringType(DOMString) - * Error(Unexpected keyword "optional" after ">".) - */ -dictionary MyDictionaryInvalidOptional { - DOMString mandatory; - sequence optional; -}; - -/* ERROR Unexpected identifier "NoColon" after identifier "ForParent". */ -dictionary ForParent NoColon { - DOMString? setString = null; -}; - -/* TREE - *Dictionary(MyDictNull) - * Key(setString) - * Type() - * StringType(DOMString) - * Default(NULL) - */ -dictionary MyDictNull { - DOMString? setString = null; -}; - -/* ERROR Unexpected keyword "attribute" after "{". */ -dictionary MyDictUnexpectedAttribute { - attribute DOMString foo = ""; -}; diff --git a/tools/idl_parser/test_parser/enum_ppapi.idl b/tools/idl_parser/test_parser/enum_ppapi.idl deleted file mode 100644 index 1b088b840098..000000000000 --- a/tools/idl_parser/test_parser/enum_ppapi.idl +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Enum productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Enum(MealType1) - * EnumItem(rice) - * EnumItem(noodles) - * EnumItem(other) -*/ -enum MealType1 { - /* BUILD EnumItem (rice) */ - rice, - /* BUILD EnumItem (noodles) */ - noodles, - /* BUILD EnumItem(other) */ - other -}; - -/* BUILD Error(Enum missing name.) */ -/* ERROR Enum missing name. */ -enum { - rice, - noodles, - other, -}; - -/* TREE - *Enum(MealType2) - * EnumItem(rice) - * EnumItem(noodles) - * EnumItem(other) -*/ -enum MealType2 { - /* BUILD EnumItem(rice) */ - rice, - /* BUILD EnumItem(noodles) */ - noodles = 1, - /* BUILD EnumItem(other) */ - other -}; - -/* BUILD Error(Unexpected identifier "noodles" after identifier "rice".) */ -/* ERROR Unexpected identifier "noodles" after identifier "rice". */ -enum MissingComma { - rice - noodles, - other -}; - -/* BUILD Error(Trailing comma in block.) */ -/* ERROR Trailing comma in block. */ -enum TrailingComma { - rice, - noodles, - other, -}; - -/* BUILD Error(Unexpected "," after ",".) */ -/* ERROR Unexpected "," after ",". */ -enum ExtraComma { - rice, - noodles, - ,other, -}; - -/* BUILD Error(Unexpected keyword "interface" after "{".) */ -/* ERROR Unexpected keyword "interface" after "{". */ -enum ExtraComma { - interface, - noodles, - ,other, -}; - -/* BUILD Error(Unexpected string "somename" after "{".) */ -/* ERROR Unexpected string "somename" after "{". */ -enum ExtraComma { - "somename", - noodles, - other, -}; - -/* BUILD Enum(MealType3) */ -enum MealType3 { - /* BUILD EnumItem(rice) */ - rice = 1 << 1, - /* BUILD EnumItem(noodles) */ - noodles = 0x1 << 0x2, - /* BUILD EnumItem(other) */ - other = 012 << 777 -}; - -/* BUILD Enum(MealType4) */ -enum MealType4 { - /* BUILD EnumItem(rice) */ - rice = true, - /* BUILD EnumItem(noodles) */ - noodles = false -}; diff --git a/tools/idl_parser/test_parser/enum_web.idl b/tools/idl_parser/test_parser/enum_web.idl deleted file mode 100644 index e3107c0ae41e..000000000000 --- a/tools/idl_parser/test_parser/enum_web.idl +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Enum productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Enum(MealType1) - * EnumItem(rice) - * EnumItem(noodles) - * EnumItem(other) -*/ -enum MealType1 { - /* BUILD EnumItem (rice) */ - "rice", - /* BUILD EnumItem (noodles) */ - "noodles", - /* BUILD EnumItem(other) */ - "other" -}; - -/* BUILD Error(Enum missing name.) */ -/* ERROR Enum missing name. */ -enum { - "rice", - "noodles", - "other" -}; - -/* TREE - *Enum(MealType2) - * EnumItem(rice) - * EnumItem(noodles) - * EnumItem(other) -*/ -enum MealType2 { - /* BUILD EnumItem(rice) */ - "rice", - /* BUILD EnumItem(noodles) */ - "noodles", - /* BUILD EnumItem(other) */ - "other" -}; - -/* TREE - *Enum(TrailingComma) - * EnumItem(rice) - * EnumItem(noodles) - * EnumItem(other) -*/ -enum TrailingComma { - "rice", - "noodles", - "other", -}; - -/* BUILD Error(Unexpected string "noodles" after string "rice".) */ -/* ERROR Unexpected string "noodles" after string "rice". */ -enum MissingComma { - "rice" - "noodles", - "other" -}; - -/* BUILD Error(Unexpected "," after ",".) */ -/* ERROR Unexpected "," after ",". */ -enum ExtraComma { - "rice", - "noodles", - ,"other", -}; - -/* BUILD Error(Unexpected keyword "interface" after "{".) */ -/* ERROR Unexpected keyword "interface" after "{". */ -enum ExtraComma { - interface, - "noodles", - ,"other", -}; - -/* BUILD Error(Unexpected identifier "somename" after "{".) */ -/* ERROR Unexpected identifier "somename" after "{". */ -enum ExtraComma { - somename, - "noodles", - ,"other", -}; - -/* BUILD Enum(MealType3) */ -enum MealType3 { - /* BUILD EnumItem(rice) */ - "rice", - /* BUILD EnumItem(noodles) */ - "noodles", - /* BUILD EnumItem(other) */ - "other" -}; - diff --git a/tools/idl_parser/test_parser/exception_web.idl b/tools/idl_parser/test_parser/exception_web.idl deleted file mode 100644 index 2e28107dfb21..000000000000 --- a/tools/idl_parser/test_parser/exception_web.idl +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Exception productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Exception(MyExc) - */ -exception MyExc { }; - -/* TREE - *Exception(MyExcInherit) - * Inherit(Foo) - */ -exception MyExcInherit : Foo {}; - -/* ERROR Unexpected keyword "exception" after keyword "partial". */ -partial exception MyExcPartial { }; - -/* TREE - *Exception(MyExcBig) - * ExceptionField(MyString) - * Type() - * StringType(DOMString) - * Error(Unexpected "=" after identifier "ErrorSetLong".) - * ExceptionField(MyLong) - * Type() - * PrimitiveType(long) - */ -exception MyExcBig { - DOMString MyString; - unsigned long long ErrorSetLong = 123; - long MyLong; -}; - - -/* ERROR Unexpected "{" after keyword "exception". */ -exception { - DOMString? setString = null; -}; - - -/* ERROR Unexpected identifier "NoColon" after identifier "ForParent". */ -exception ForParent NoColon { - DOMString? setString = null; -}; - -/* TREE - *Exception(MyExcConst) - * Const(setString) - * StringType(DOMString) - * Value(NULL) - */ -exception MyExcConst { - const DOMString? setString = null; -}; - - - - diff --git a/tools/idl_parser/test_parser/extattr_ppapi.idl b/tools/idl_parser/test_parser/extattr_ppapi.idl deleted file mode 100644 index 07afbc00be78..000000000000 --- a/tools/idl_parser/test_parser/extattr_ppapi.idl +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test ExtendedAttribute productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - * Arguments() - */ - -[foo()] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - * Values() - */ - -[foo(1)] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - * Values() - */ - -[foo(1 true 1.2e-3)] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - * Arguments() - * Error(Unexpected ).) - */ - -[foo(null)] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - */ - -[foo=1] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - */ - -[foo=true] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - */ - -[foo=1.2e-3] interface Foo {}; - -/* TREE - *Interface(Foo) - * ExtAttributes() - * ExtAttribute(foo) - */ - -[foo=(bar, baz)] interface Foo {}; diff --git a/tools/idl_parser/test_parser/implements_web.idl b/tools/idl_parser/test_parser/implements_web.idl deleted file mode 100644 index 252dd4bb7f83..000000000000 --- a/tools/idl_parser/test_parser/implements_web.idl +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Implements productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* BUILD Implements(A) */ -/* PROP REFERENCE=B */ -A implements B; - -/* ERROR Unexpected ";" after keyword "implements". */ -A implements; - -/* BUILD Implements(B) */ -/* PROP REFERENCE=C */ -B implements C; - -/* ERROR Unexpected keyword "implements" after "]". */ -[foo] implements B; - -/* BUILD Implements(D) */ -/* PROP REFERENCE=E */ -D implements E; - -/* ERROR Unexpected keyword "implements" after comment. */ -implements C; - diff --git a/tools/idl_parser/test_parser/inline_ppapi.idl b/tools/idl_parser/test_parser/inline_ppapi.idl deleted file mode 100644 index 134f60d7f1b7..000000000000 --- a/tools/idl_parser/test_parser/inline_ppapi.idl +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Typedef productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Inline(C) - */ - -#inline C -This is my block of C code -#endinl - -/* TREE - *Inline(CC) - */ -#inline CC -This is my block of CC code -#endinl - diff --git a/tools/idl_parser/test_parser/interface_web.idl b/tools/idl_parser/test_parser/interface_web.idl deleted file mode 100644 index c8ec6d264354..000000000000 --- a/tools/idl_parser/test_parser/interface_web.idl +++ /dev/null @@ -1,442 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Interface productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Interface(MyIFace) - */ -interface MyIFace { }; - -/* TREE - *Interface(MyIFaceInherit) - * Inherit(Foo) - */ -interface MyIFaceInherit : Foo {}; - -/* TREE - *Interface(MyIFacePartial) - */ -partial interface MyIFacePartial { }; - -/* ERROR Unexpected ":" after identifier "MyIFaceInherit". */ -partial interface MyIFaceInherit : Foo {}; - -/* TREE - *Interface(MyIFaceMissingArgument) - * Operation(foo) - * Arguments() - * Argument(arg) - * Type() - * StringType(DOMString) - * Error(Missing argument.) - * Type() - * PrimitiveType(void) - */ -interface MyIFaceMissingArgument { - void foo(DOMString arg, ); -}; - -/* TREE - *Error(Unexpected keyword "double" after keyword "readonly".) - */ -interface MyIFaceMissingAttribute { - readonly double foo; -}; - -/* TREE - *Interface(MyIFaceContainsUnresolvedConflictDiff) - * Operation(foo) - * Arguments() - * Type() - * StringType(DOMString) - * Error(Unexpected "<" after ";".) - */ -interface MyIFaceContainsUnresolvedConflictDiff { - DOMString foo(); -<<<<<< ours - DOMString bar(); - iterable; -====== ->>>>>> theirs -}; - -/* TREE - *Interface(MyIFaceWrongRecordKeyType) - * Operation(foo) - * Arguments() - * Argument(arg) - * Type() - * Error(Unexpected identifier "int" after "<".) - * Type() - * PrimitiveType(void) - */ -interface MyIFaceWrongRecordKeyType { - void foo(record arg); -}; - -/* TREE - *Interface(MyIFaceBig) - * Const(setString) - * StringType(DOMString) - * Value(NULL) - */ -interface MyIFaceBig { - const DOMString? setString = null; -}; - -/* TREE - *Interface(MyIfaceEmptySequenceDefalutValue) - * Operation(foo) - * Arguments() - * Argument(arg) - * Type() - * Sequence() - * Type() - * StringType(DOMString) - * Default() - * Type() - * PrimitiveType(void) - */ -interface MyIfaceEmptySequenceDefalutValue { - void foo(optional sequence arg = []); -}; - -/* TREE - *Interface(MyIfaceWithRecords) - * Operation(foo) - * Arguments() - * Argument(arg) - * Type() - * Record() - * StringType(DOMString) - * Type() - * PrimitiveType(long) - * Type() - * PrimitiveType(void) - * Operation(bar) - * Arguments() - * Argument(arg1) - * Type() - * Typeref(int) - * Argument(arg2) - * Type() - * Record() - * StringType(ByteString) - * Type() - * PrimitiveType(float) - * Type() - * PrimitiveType(double) - */ -interface MyIfaceWithRecords { - void foo(record arg); - double bar(int arg1, record arg2); -}; - -/* TREE - *Interface(MyIFaceBig2) - * Const(nullValue) - * StringType(DOMString) - * Value(NULL) - * Const(longValue) - * PrimitiveType(long) - * Value(123) - * Const(longValue2) - * PrimitiveType(long long) - * Value(123) - * Attribute(myString) - * Type() - * StringType(DOMString) - * Attribute(readOnlyString) - * Type() - * StringType(DOMString) - * Attribute(staticString) - * Type() - * StringType(DOMString) - * Operation(myFunction) - * Arguments() - * Argument(myLong) - * Type() - * PrimitiveType(long long) - * Type() - * PrimitiveType(void) - * Operation(staticFunction) - * Arguments() - * Argument(myLong) - * Type() - * PrimitiveType(long long) - * Type() - * PrimitiveType(void) - */ -interface MyIFaceBig2 { - const DOMString? nullValue = null; - const long longValue = 123; - const long long longValue2 = 123; - attribute DOMString myString; - readonly attribute DOMString readOnlyString; - static attribute DOMString staticString; - void myFunction(long long myLong); - static void staticFunction(long long myLong); -}; - - -/* TREE - *Interface(MyIFaceSpecials) - * Operation(set) - * Arguments() - * Argument(property) - * Type() - * StringType(DOMString) - * Type() - * PrimitiveType(void) - * Operation(_unnamed_) - * Arguments() - * Argument(property) - * Type() - * StringType(DOMString) - * Type() - * PrimitiveType(double) - * Operation(GetFiveSix) - * Arguments() - * Argument(arg) - * Type() - * Typeref(SomeType) - * Type() - * PrimitiveType(long long) - * Array(5) - * Array(6) - */ -interface MyIFaceSpecials { - setter creator void set(DOMString property); - getter double (DOMString property); - long long [5][6] GetFiveSix(SomeType arg); -}; - -/* TREE - *Interface(MyIFaceStringifiers) - * Stringifier() - * Stringifier() - * Operation(_unnamed_) - * Arguments() - * Type() - * StringType(DOMString) - * Stringifier() - * Operation(namedStringifier) - * Arguments() - * Type() - * StringType(DOMString) - * Stringifier() - * Attribute(stringValue) - * Type() - * StringType(DOMString) - */ -interface MyIFaceStringifiers { - stringifier; - stringifier DOMString (); - stringifier DOMString namedStringifier(); - stringifier attribute DOMString stringValue; -}; - -/* TREE - *Interface(MyExtendedAttributeInterface) - * Operation(method) - * Arguments() - * Type() - * PrimitiveType(void) - * ExtAttributes() - * ExtAttribute(Attr) - * ExtAttribute(MethodIdentList) - * ExtAttributes() - * ExtAttribute(MyExtendedAttribute) - * ExtAttribute(MyExtendedIdentListAttribute) - */ -[MyExtendedAttribute, - MyExtendedIdentListAttribute=(Foo, Bar, Baz)] -interface MyExtendedAttributeInterface { - [Attr, MethodIdentList=(Foo, Bar)] void method(); -}; - -/* TREE - *Interface(MyIfacePromise) - * Operation(method1) - * Arguments() - * Type() - * Promise(Promise) - * Type() - * PrimitiveType(void) - * Operation(method2) - * Arguments() - * Type() - * Promise(Promise) - * Type() - * PrimitiveType(long) - * Operation(method3) - * Arguments() - * Type() - * Promise(Promise) - * Type() - * Any() - * Operation(method4) - * Arguments() - * Type() - * Promise(Promise) - * Type() - * Any() - */ -interface MyIfacePromise { - Promise method1(); - Promise method2(); - Promise method3(); - Promise method4(); -}; - -/* TREE - *Interface(MyIfaceIterable) - * Iterable() - * Type() - * PrimitiveType(long) - * Iterable() - * Type() - * PrimitiveType(double) - * Type() - * StringType(DOMString) - * LegacyIterable() - * Type() - * PrimitiveType(boolean) - */ -interface MyIfaceIterable { - iterable; - iterable; - legacyiterable; -}; - -/* TREE - *Interface(MyIfaceMaplike) - * Maplike() - * Type() - * PrimitiveType(long) - * Type() - * StringType(DOMString) - * Maplike() - * Type() - * PrimitiveType(double) - * Type() - * PrimitiveType(boolean) - */ -interface MyIfaceMaplike { - readonly maplike; - maplike; -}; - -/* TREE - *Interface(MyIfaceSetlike) - * Setlike() - * Type() - * PrimitiveType(long) - * Setlike() - * Type() - * PrimitiveType(double) - */ -interface MyIfaceSetlike { - readonly setlike; - setlike; -}; - -/* TREE - *Interface(MyIfaceSerializer) - * Serializer() - * Serializer() - * Operation(toJSON) - * Arguments() - * Type() - * Any() - * Serializer() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * Map() - * Serializer() - * List() - * Serializer() - * List() - * Serializer() - * List() - */ -interface MyIfaceSerializer { - serializer; - serializer any toJSON(); - serializer = name; - serializer = {}; - serializer = { getter }; - serializer = { attribute }; - serializer = { inherit, attribute }; - serializer = { inherit }; - serializer = { inherit, name1, name2 }; - serializer = { name1, name2 }; - serializer = []; - serializer = [getter]; - serializer = [name1, name2]; -}; - -/* TREE - *Interface(MyIfaceFrozenArray) - * Attribute(foo) - * Type() - * FrozenArray() - * Type() - * StringType(DOMString) - */ -interface MyIfaceFrozenArray { - readonly attribute FrozenArray foo; -}; - -/* TREE - *Interface(MyIfaceUnion) - * Attribute(foo) - * Type() - * UnionType() - * Type() - * StringType(DOMString) - * Type() - * PrimitiveType(long) - */ -interface MyIfaceUnion { - attribute (DOMString or long) foo; -}; diff --git a/tools/idl_parser/test_parser/label_ppapi.idl b/tools/idl_parser/test_parser/label_ppapi.idl deleted file mode 100644 index 264699dd8e9a..000000000000 --- a/tools/idl_parser/test_parser/label_ppapi.idl +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Typedef productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Label(Chrome1) - * LabelItem(M13) - */ -label Chrome1 { - M13 = 0.0 -}; - -/* TREE - *Label(Chrome2) - * LabelItem(M12) - * LabelItem(M13) - */ -label Chrome2 { - M12 = 1.0, - M13 = 2.0, -}; \ No newline at end of file diff --git a/tools/idl_parser/test_parser/struct_ppapi.idl b/tools/idl_parser/test_parser/struct_ppapi.idl deleted file mode 100644 index 59bc7eb86486..000000000000 --- a/tools/idl_parser/test_parser/struct_ppapi.idl +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Struct productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Struct(MyStruct) - * Member(x) - * Type() - * PrimitiveType(uint32_t) - * Member(y) - * Type() - * PrimitiveType(uint64_t) - * Member(string) - * ExtAttributes() - * ExtAttribute(fake_attribute) - * Type() - * PrimitiveType(str_t) - * Member(z) - * Type() - * Typeref(Promise) - * ExtAttributes() - * ExtAttribute(union) - */ -[union] struct MyStruct { - uint32_t x; - uint64_t y; - [fake_attribute] str_t string; - Promise z; -}; diff --git a/tools/idl_parser/test_parser/typedef_ppapi.idl b/tools/idl_parser/test_parser/typedef_ppapi.idl deleted file mode 100644 index 1a80415f596a..000000000000 --- a/tools/idl_parser/test_parser/typedef_ppapi.idl +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Typedef productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - -/* TREE - *Callback(foo) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(x) - * Type() - * PrimitiveType(int32_t) - */ -callback foo = void (int32_t x); - -/* TREE - *Callback(foo) - * Type() - * PrimitiveType(void) - * Arguments() - * Argument(x) - * Type() - * PrimitiveType(int32_t) - */ -typedef void foo(int32_t x); - -/* TREE - *Typedef(MyLong) - * Type() - * PrimitiveType(int32_t) - */ -typedef int32_t MyLong; - -/* TREE - *Typedef(MyLongArray) - * Type() - * PrimitiveType(str_t) - * Array() - */ -typedef str_t[] MyLongArray; - -/* TREE - *Typedef(MyLongArray5) - * Type() - * PrimitiveType(mem_t) - * Array(5) - */ -typedef mem_t[5] MyLongArray5; - -/* TREE - *Typedef(MyLongArrayN5) - * Type() - * PrimitiveType(handle_t) - * Array() - * Array(5) - */ -typedef handle_t[][5] MyLongArrayN5; - - -/* TREE - *Typedef(bar) - * Type() - * Typeref(foo) - */ -typedef foo bar; \ No newline at end of file diff --git a/tools/idl_parser/test_parser/typedef_web.idl b/tools/idl_parser/test_parser/typedef_web.idl deleted file mode 100644 index 6e651c1e2ae0..000000000000 --- a/tools/idl_parser/test_parser/typedef_web.idl +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (c) 2013 The Chromium Authors. All rights reserved. - Use of this source code is governed by a BSD-style license that can be - found in the LICENSE file. */ - -/* Test Typedef productions - -Run with --test to generate an AST and verify that all comments accurately -reflect the state of the Nodes. - -BUILD Type(Name) -This comment signals that a node of type is created with the -name . - -ERROR Error String -This comment signals that a error of is generated. The error -is not assigned to a node, but are expected in order. - -PROP Key=Value -This comment signals that a property has been set on the Node such that - = . - -TREE -Type(Name) - Type(Name) - Type(Name) - Type(Name) - ... -This comment signals that a tree of nodes matching the BUILD comment -symatics should exist. This is an exact match. -*/ - - -/* TREE - *Typedef(MyLong) - * Type() - * PrimitiveType(long) - */ -typedef long MyLong; - -/* TREE - *Typedef(MyLong) - * ExtAttributes() - * ExtAttribute(foo) - * Type() - * PrimitiveType(long) - */ -typedef [foo] long MyLong; - -/* TREE - *Typedef(MyLongArray) - * Type() - * PrimitiveType(long) - * Array() - */ -typedef long[] MyLongArray; - -/* TREE - *Typedef(MyLongSizedArray) - * Type() - * PrimitiveType(long) - * Array(4) - */ -typedef long[4] MyLongSizedArray; - -/* TREE - *Typedef(MyLongSizedArrayArray) - * Type() - * PrimitiveType(long) - * Array(4) - * Array(5) - */ -typedef long[4][5] MyLongSizedArrayArray; - -/* TREE - *Typedef(MyLongArraySizedArray) - * Type() - * PrimitiveType(long) - * Array() - * Array(5) - */ -typedef long[][5] MyLongArraySizedArray; - -/* TREE - *Typedef(MyTypeFive) - * Type() - * Typeref(MyType) - * Array(5) - */ -typedef MyType[5] MyTypeFive; - -/* TREE - *Typedef(MyTypeUnsizedFive) - * Type() - * Typeref(MyType) - * Array() - * Array(5) - */ -typedef MyType[][5] MyTypeUnsizedFive; - -/* TREE - *Typedef(MyLongLong) - * Type() - * PrimitiveType(long long) - */ -typedef long long MyLongLong; - -/* TREE - *Typedef(MyULong) - * Type() - * PrimitiveType(unsigned long) - */ -typedef unsigned long MyULong; - -/* TREE - *Typedef(MyULongLong) - * Type() - * PrimitiveType(unsigned long long) - */ -typedef unsigned long long MyULongLong; - -/* TREE - *Typedef(MyString) - * Type() - * StringType(DOMString) - */ -typedef DOMString MyString; - -/* TREE - *Typedef(MyObject) - * Type() - * PrimitiveType(object) - */ -typedef object MyObject; - -/* TREE - *Typedef(MyDate) - * Type() - * PrimitiveType(Date) - */ -typedef Date MyDate; - -/* TREE - *Typedef(MyFloat) - * Type() - * PrimitiveType(float) - */ -typedef float MyFloat; - -/* TREE - *Typedef(MyUFloat) - * Type() - * PrimitiveType(float) - */ -typedef unrestricted float MyUFloat; - -/* TREE - *Typedef(MyDouble) - * Type() - * PrimitiveType(double) - */ -typedef double MyDouble; - -/* TREE - *Typedef(MyUDouble) - * Type() - * PrimitiveType(double) - */ -typedef unrestricted double MyUDouble; - -/* TREE - *Typedef(MyBool) - * Type() - * PrimitiveType(boolean) - */ -typedef boolean MyBool; - -/* TREE - *Typedef(MyByte) - * Type() - * PrimitiveType(byte) - */ -typedef byte MyByte; - -/* TREE - *Typedef(MyOctet) - * Type() - * PrimitiveType(octet) - */ -typedef octet MyOctet; - -/* TREE - *Typedef(MyRecord) - * Type() - * Record() - * StringType(ByteString) - * Type() - * Typeref(int) - */ -typedef record MyRecord; - -/* TREE - *Typedef(MyInvalidRecord) - * Type() - * Error(Unexpected keyword "double" after "<".) - */ -typedef record MyInvalidRecord;