Home | History | Annotate | Download | only in preprocessor
      1 #!/bin/bash
      2 # Copyright 2016 The SwiftShader Authors. All Rights Reserved.
      3 #
      4 # Licensed under the Apache License, Version 2.0 (the "License");
      5 # you may not use this file except in compliance with the License.
      6 # You may obtain a copy of the License at
      7 #
      8 #    http://www.apache.org/licenses/LICENSE-2.0
      9 #
     10 # Unless required by applicable law or agreed to in writing, software
     11 # distributed under the License is distributed on an "AS IS" BASIS,
     12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     15 
     16 # Generates various components of GLSL ES preprocessor.
     17 
     18 run_flex()
     19 {
     20 input_file=$script_dir/$1
     21 output_source=$script_dir/$2
     22 flex --noline --nounistd --outfile=$output_source $input_file
     23 }
     24 
     25 run_bison()
     26 {
     27 input_file=$script_dir/$1
     28 output_source=$script_dir/$2
     29 bison --no-lines --skeleton=yacc.c --output=$output_source $input_file
     30 }
     31 
     32 script_dir=$(dirname $0)
     33 
     34 # Generate preprocessor
     35 run_flex Tokenizer.l Tokenizer.cpp
     36 run_bison ExpressionParser.y ExpressionParser.cpp
     37