Skip to content

Commit

Permalink
Added clarifying comments for various components of the script; reimp…
Browse files Browse the repository at this point in the history
…lemented the adding of flags to contlex content with input/output being the same, hopefully improving its accuracy.
  • Loading branch information
aarppe committed Nov 7, 2024
1 parent 3caa3c9 commit 3d3402e
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions tools/shellscripts/add-lexicon-and-tag-flags-2-lexc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ END {
for(i=1; i<=NR; i++)
{
# Incorporating declarations of flags for continuation lexica and tags
if(index(line[i], "Multichar_Symbols")!=0)
{
print line[i];
Expand All @@ -76,7 +77,9 @@ END {
printf "\n";
i++;
}
# Incorporating flags for contlexs in their content
# First, determining flag for LEXICON
if(match(line[i], "^LEXICON[ \t]+([^ \t]+)", f)!=0)
{
print line[i];
Expand Down Expand Up @@ -150,14 +153,32 @@ END {
}
else
{
if(match(content, "^[ ]*[^ ]+[ ]*;")!=0)
content=lexflag content;
# 1) No lexical content:
# ^CONTLEX;
# ^CONTLEX ;
# ^ CONTLEX;
# ^ CONTLEX ;
# 2) Same lexical content on both sides:
# ^lex CONTLEX;
# ^lex CONTLEX ;
# ^ lex CONTLEX;
# ^0 CONTLEX;
# ^0 CONTLEX ;
if(match(content, "^[ ]*([^ ]+[ ]+[^ ]+[ ]*)", ffff)!=0)
{
sub("^[ ]*", "", ffff[1]);
content=lexflag "" ffff[1];
}
else
content=lexflag " " content;
gsub("@ @", "@@", content);
{
sub("^[ ]*", "", content);
content=lexflag " " content;
}
}
print content sep comment;
}
else
print line[i];
Expand Down

0 comments on commit 3d3402e

Please sign in to comment.