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 18run_flex() 19{ 20input_file=$script_dir/$1 21output_source=$script_dir/$2 22flex --noline --nounistd --outfile=$output_source $input_file 23} 24 25run_bison() 26{ 27input_file=$script_dir/$1 28output_source=$script_dir/$2 29bison --no-lines --skeleton=yacc.c --output=$output_source $input_file 30} 31 32script_dir=$(dirname $0) 33 34# Generate preprocessor 35run_flex Tokenizer.l Tokenizer.cpp 36run_bison ExpressionParser.y ExpressionParser.cpp 37