OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_ast.py
Go to the documentation of this file.
1 from __future__ import print_function
2 
3 import sys
4 import re
5 
6 if len(sys.argv) > 1:
7  with open(sys.argv[1], 'r') as f:
8  for line in f:
9  if 'FunctionDecl' in line and 'ExtensionFunctions' in line:
10  line = re.sub("-FunctionDecl.*line:[0-9]+:[0-9]+", "", line).lstrip()
11  if not line.startswith('| '):
12  # .ast lines must start with `| `, see ExtensionFunctionSignatureParser.parse
13  line = '| ' + line
14  print(line, end='')
15 else:
16  for line in sys.stdin:
17  if 'FunctionDecl' in line and 'ExtensionFunctions' in line:
18  line = re.sub("-FunctionDecl.*line:[0-9]+:[0-9]+", "", line).lstrip()
19  if not line.startswith('| '):
20  line = '| ' + line
21  print(line, end ='')
int open(const char *path, int flags, int mode)
Definition: omnisci_fs.cpp:64