1cdf0e10cSrcweir#!/usr/bin/env python
2*184e05d2SAndrew Rist# *************************************************************
3*184e05d2SAndrew Rist#
4*184e05d2SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
5*184e05d2SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
6*184e05d2SAndrew Rist#  distributed with this work for additional information
7*184e05d2SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
8*184e05d2SAndrew Rist#  to you under the Apache License, Version 2.0 (the
9*184e05d2SAndrew Rist#  "License"); you may not use this file except in compliance
10*184e05d2SAndrew Rist#  with the License.  You may obtain a copy of the License at
11*184e05d2SAndrew Rist#
12*184e05d2SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
13*184e05d2SAndrew Rist#
14*184e05d2SAndrew Rist#  Unless required by applicable law or agreed to in writing,
15*184e05d2SAndrew Rist#  software distributed under the License is distributed on an
16*184e05d2SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17*184e05d2SAndrew Rist#  KIND, either express or implied.  See the License for the
18*184e05d2SAndrew Rist#  specific language governing permissions and limitations
19*184e05d2SAndrew Rist#  under the License.
20*184e05d2SAndrew Rist#
21*184e05d2SAndrew Rist# *************************************************************
22cdf0e10cSrcweir
23cdf0e10cSrcweirimport macroparser
24cdf0e10cSrcweir
25cdf0e10cSrcweirdef runParser (buf):
26cdf0e10cSrcweir    mparser = macroparser.MacroParser(buf)
27cdf0e10cSrcweir    mparser.debug = True
28cdf0e10cSrcweir    mparser.parse()
29cdf0e10cSrcweir
30cdf0e10cSrcweirdef main ():
31cdf0e10cSrcweir    buf = 'FOO   (asdfsdaf)'
32cdf0e10cSrcweir    runParser(buf)
33cdf0e10cSrcweir    buf = 'FOO (x, y)  (x) + (y)'
34cdf0e10cSrcweir    runParser(buf)
35cdf0e10cSrcweir    buf = 'FOO(x, y)  (x) + (y)'
36cdf0e10cSrcweir    runParser(buf)
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweirif __name__ == '__main__':
40cdf0e10cSrcweir    main()
41