Mon, 01 Sep 2025 00:14:59 +0800
Initial Lexer/Parser
project('tlvc', 'c', version : '0.1', default_options : ['warning_level=3']) flex = find_program('flex') bison = find_program('bison') lexer = generator( flex, output : [ '@BASENAME@.yy.c', '@BASENAME@.yy.h' ], arguments : [ '--outfile=@OUTPUT0@', '--header-file=@OUTPUT1@', '@INPUT@' ] ) parser = generator( bison, output : [ '@BASENAME@.tab.c', '@BASENAME@.tab.h' ], arguments : [ '-d', '@INPUT@', '-v', '--output=@OUTPUT0@', '--defines=@OUTPUT1@' ] ) parser_src = parser.process('tlvc.y') lexer_src = lexer.process('tlvc.l') SOURCES = [ 'tlvc.c', parser_src, lexer_src, ] exe = executable('tlvc', SOURCES, include_directories : include_directories('.'), install : true) test('basic', exe)