mirror of
https://github.com/verilator/verilator.git
synced 2025-04-15 17:16:55 +00:00
Change lexer to more closely match Verilog-Perl. Should be no functional change
This commit is contained in:
parent
0985f675e3
commit
851b022c7a
61
nodist/flexdiff
Executable file
61
nodist/flexdiff
Executable file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/perl -w
|
||||
######################################################################
|
||||
#
|
||||
# Copyright 2007-2009 by Wilson Snyder. This package is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
######################################################################
|
||||
|
||||
# DESCRIPTION: Diff flex files
|
||||
|
||||
use IO::File;
|
||||
use strict;
|
||||
|
||||
my $Debug;
|
||||
|
||||
diff($ARGV[0],$ARGV[1]);
|
||||
|
||||
sub diff {
|
||||
my $a=shift;
|
||||
my $b=shift;
|
||||
|
||||
my $ta = "/tmp/flexdiff.$$.a";
|
||||
my $tb = "/tmp/flexdiff.$$.b";
|
||||
|
||||
prep($a,$ta);
|
||||
prep($b,$tb);
|
||||
|
||||
system("diff -u -w $ta $tb");
|
||||
}
|
||||
|
||||
sub prep {
|
||||
my $filename = shift;
|
||||
my $wfilename = shift;
|
||||
|
||||
my $fh = IO::File->new("<$filename") or die "%Error: $! $filename";
|
||||
my $fho = IO::File->new(">$wfilename") or die "%Error: $! writing $wfilename";
|
||||
|
||||
my %declared;
|
||||
my %used;
|
||||
my @lines;
|
||||
|
||||
while (defined(my $line = $fh->getline)) {
|
||||
# Productions
|
||||
$line =~ s/[ \t]{[^}]*?}/\t{}/g;
|
||||
push @lines, $line;
|
||||
}
|
||||
|
||||
#@lines = sort @lines;
|
||||
$fho->print(@lines);
|
||||
}
|
||||
|
||||
# Local Variables:
|
||||
# compile-command: "./flexdiff $WUP/Verilog/Parser/VParseLex.l ../src/verilog.l"
|
||||
# End:
|
977
src/verilog.l
977
src/verilog.l
File diff suppressed because it is too large
Load Diff
@ -243,8 +243,8 @@ class AstSenTree;
|
||||
%token<fileline> yPOSEDGE "posedge"
|
||||
%token<fileline> yPRIORITY "priority"
|
||||
%token<fileline> yPROPERTY "property"
|
||||
%token<fileline> yPULLDOWN "pulldown"
|
||||
%token<fileline> yPULLUP "pullup"
|
||||
%token<fileline> yPULLDOWN "pulldown"
|
||||
%token<fileline> yPULLUP "pullup"
|
||||
%token<fileline> yREG "reg"
|
||||
%token<fileline> yREPEAT "repeat"
|
||||
%token<fileline> ySCALARED "scalared"
|
||||
@ -318,6 +318,8 @@ class AstSenTree;
|
||||
%token<fileline> yVL_PUBLIC_FLAT "/*verilator public_flat*/"
|
||||
%token<fileline> yVL_PUBLIC_MODULE "/*verilator public_module*/"
|
||||
|
||||
%token<fileline> yP_TICK "'"
|
||||
%token<fileline> yP_TICKBRA "'{"
|
||||
%token<fileline> yP_OROR "||"
|
||||
%token<fileline> yP_ANDAND "&&"
|
||||
%token<fileline> yP_NOR "~|"
|
||||
@ -352,7 +354,12 @@ class AstSenTree;
|
||||
%token<fileline> yP_COLONDIV ":/"
|
||||
%token<fileline> yP_ORMINUSGT "|->"
|
||||
%token<fileline> yP_OREQGT "|=>"
|
||||
%token<fileline> yP_BRASTAR "[*"
|
||||
%token<fileline> yP_BRAEQ "[="
|
||||
%token<fileline> yP_BRAMINUSGT "[->"
|
||||
|
||||
%token<fileline> yP_PLUSPLUS "++"
|
||||
%token<fileline> yP_MINUSMINUS "--"
|
||||
%token<fileline> yP_PLUSEQ "+="
|
||||
%token<fileline> yP_MINUSEQ "-="
|
||||
%token<fileline> yP_TIMESEQ "*="
|
||||
@ -1747,6 +1754,11 @@ AstText* V3Parse::createTextQuoted(FileLine* fileline, string text) {
|
||||
return new AstText(fileline, newtext);
|
||||
}
|
||||
|
||||
//YACC = /kits/sources/bison-2.4.1/src/bison --report=lookahead
|
||||
// --report=lookahead
|
||||
// --report=itemset
|
||||
// --graph
|
||||
//
|
||||
// Local Variables:
|
||||
// compile-command: "cd obj_dbg ; /usr/bin/bison -y -d -v ../verilog.y ; cat y.output"
|
||||
// End:
|
||||
|
Loading…
Reference in New Issue
Block a user