8 //===-- SBLanguages.h -----------------------------------------*- C++ -*-===//
10 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
11 // See https://llvm.org/LICENSE.txt for license information.
12 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //===----------------------------------------------------------------------===//
16 #ifndef LLDB_API_SBLANGUAGE_H
17 #define LLDB_API_SBLANGUAGE_H
22 /// Used by \\ref SBExpressionOptions.
23 /// These enumerations use the same language enumerations as the DWARF
24 /// specification for ease of use and consistency.
25 enum SBSourceLanguageName : uint16_t {
37 r
'^ *HANDLE_DW_LNAME *\( *(?P<value>[^,]+), (?P<name>.*), "(?P<comment>[^"]+)",.*\)'
41 def emit_enum(input, output
):
42 # Read the input and break it up by lines.
44 with
open(input, "r") as f
:
47 # Create output folder if it does not exist
48 os
.makedirs(os
.path
.dirname(output
), exist_ok
=True)
51 with
open(output
, "w") as f
:
55 # Emit the enum values.
57 match
= REGEX
.match(line
)
60 f
.write(f
" /// {match.group('comment')}.\n")
61 f
.write(f
" eLanguageName{match.group('name')} = {match.group('value')},\n")
68 parser
= argparse
.ArgumentParser()
69 parser
.add_argument("--output", "-o")
70 parser
.add_argument("input")
71 args
= parser
.parse_args()
73 emit_enum(args
.input, args
.output
)
76 if __name__
== "__main__":