From 785aad94c5e30081913f4830b4a2a8654c634feb Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 23 Apr 2008 13:55:04 -0700 Subject: [PATCH] Ignore a few more compiler directives. This patch adds `default_decay_time, `default_trireg_strength, `delay_mode_zero and `line as ignored compiler directives. --- ivlpp/main.c | 40 ++++++++++++++++++++++------------------ lexor.lex | 32 ++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/ivlpp/main.c b/ivlpp/main.c index 2aef0f32d..2727dd7db 100644 --- a/ivlpp/main.c +++ b/ivlpp/main.c @@ -1,5 +1,5 @@ const char COPYRIGHT[] = - "Copyright (c) 1999-2007 Stephen Williams (steve@icarus.com)"; + "Copyright (c) 1999-2008 Stephen Williams (steve@icarus.com)"; /* * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -202,23 +202,27 @@ int main(int argc, char*argv[]) FILE*precomp_out = NULL; /* Define preprocessor keywords that I plan to just pass. */ - define_macro("celldefine", "`celldefine", 1, 0); - define_macro("default_nettype", "`default_nettype", 1, 0); - define_macro("delay_mode_distributed", "`delay_mode_distributed", 1, 0); - define_macro("delay_mode_unit", "`delay_mode_unit", 1, 0); - define_macro("delay_mode_path", "`delay_mode_path", 1, 0); - define_macro("disable_portfaults", "`disable_portfaults", 1, 0); - define_macro("enable_portfaults", "`enable_portfaults", 1, 0); - define_macro("endcelldefine", "`endcelldefine", 1, 0); - define_macro("endprotect", "`endprotect", 1, 0); - define_macro("nosuppress_faults", "`nosuppress_faults", 1, 0); - define_macro("nounconnected_drive", "`nounconnected_drive", 1, 0); - define_macro("protect", "`protect", 1, 0); - define_macro("resetall", "`resetall", 1, 0); - define_macro("suppress_faults", "`suppress_faults", 1, 0); - define_macro("timescale", "`timescale", 1, 0); - define_macro("unconnected_drive", "`unconnected_drive", 1, 0); - define_macro("uselib", "`uselib", 1, 0); + define_macro("celldefine", "`celldefine", 1, 0); + define_macro("default_decay_time", "`default_decay_time", 1, 0); + define_macro("default_nettype", "`default_nettype", 1, 0); + define_macro("default_trireg_strength", "`default_trireg_strength", 1, 0); + define_macro("delay_mode_distributed", "`delay_mode_distributed", 1, 0); + define_macro("delay_mode_unit", "`delay_mode_unit", 1, 0); + define_macro("delay_mode_path", "`delay_mode_path", 1, 0); + define_macro("delay_mode_zero", "`delay_mode_zero", 1, 0); + define_macro("disable_portfaults", "`disable_portfaults", 1, 0); + define_macro("enable_portfaults", "`enable_portfaults", 1, 0); + define_macro("endcelldefine", "`endcelldefine", 1, 0); + define_macro("endprotect", "`endprotect", 1, 0); + define_macro("line", "`line", 1, 0); + define_macro("nosuppress_faults", "`nosuppress_faults", 1, 0); + define_macro("nounconnected_drive", "`nounconnected_drive", 1, 0); + define_macro("protect", "`protect", 1, 0); + define_macro("resetall", "`resetall", 1, 0); + define_macro("suppress_faults", "`suppress_faults", 1, 0); + define_macro("timescale", "`timescale", 1, 0); + define_macro("unconnected_drive", "`unconnected_drive", 1, 0); + define_macro("uselib", "`uselib", 1, 0); include_cnt = 2; include_dir = malloc(include_cnt*sizeof(char*)); diff --git a/lexor.lex b/lexor.lex index 1672d9a3e..aeefa0b2e 100644 --- a/lexor.lex +++ b/lexor.lex @@ -301,21 +301,25 @@ W [ \t\b\f\r]+ /* These are directives that I do not yet support. I think that IVL should handle these, not an external preprocessor. */ -^{W}?`celldefine{W}?.* { } +^{W}?`celldefine{W}?.* { } +^{W}?`default_decay_time{W}?.* { } +^{W}?`default_trireg_strength{W}?.* { } ^{W}?`delay_mode_distributed{W}?.* { } -^{W}?`delay_mode_unit{W}?.* { } -^{W}?`delay_mode_path{W}?.* { } -^{W}?`disable_portfaults{W}?.* { } -^{W}?`enable_portfaults{W}?.* { } -^{W}?`endcelldefine{W}?.* { } -`endprotect { } -^{W}?`nosuppress_faults{W}?.* { } -^{W}?`nounconnected_drive{W}?.* { } -`protect { } -^{W}?`resetall{W}?.* { } -^{W}?`suppress_faults{W}?.* { } -^{W}?`unconnected_drive{W}?.* { } -^{W}?`uselib{W}?.* { } +^{W}?`delay_mode_unit{W}?.* { } +^{W}?`delay_mode_path{W}?.* { } +^{W}?`delay_mode_zero{W}?.* { } +^{W}?`disable_portfaults{W}?.* { } +^{W}?`enable_portfaults{W}?.* { } +^{W}?`endcelldefine{W}?.* { } +`endprotect { } +^{W}?`line{W}?.* { } +^{W}?`nosuppress_faults{W}?.* { } +^{W}?`nounconnected_drive{W}?.* { } +`protect { } +^{W}?`resetall{W}?.* { } +^{W}?`suppress_faults{W}?.* { } +^{W}?`unconnected_drive{W}?.* { } +^{W}?`uselib{W}?.* { } /* Notice and handle the default_nettype directive. The lexor detects the default_nettype keyword, and the second part of the