Optional grammar fragments can be a problem too. If you want to try using optional syntax, use google to search for that. I advise against it. Instead of thinking in terms of optional syntax fragments, instead think of two different fragments -- one with the seemingly optional part, and one without. The problem with optional fragments is that they seem to be magnets for bison errors. For example, a source module may or may not define any grammar fragments -- it might be empty or only comments. You...
Optional grammar fragments can be a problem too. Instead of thinking in terms of optional syntax fragments, instead thing of two different fragments -- one with the seemingly optional part, and one without. The problem with optional fragments is that they seem to be magnets for bsion errors. I try to reserve optional syntax for the one case it has to exist: An empty source file should be allowed, so you have a top level, module level grammar fragment that either has definitions in it or it does....
More good advice: don't duplicate syntax fragments textually -- instead make a grammar fragment and use it instead of the duplication. This doesn't prevent all painful debug sessions with bison error messages, but it does reduce them quite a bit. For example, don't do this: target: OPEN_PAREN FRED CLOSE_PAREN other stuff; second: OPEN_PAREN FRED CLOSE_PAREN even more stuff; I'm not positive this exact text will get you into trouble, but you get the idea: duplicating fragments will ultimately burn...
By the way, as bison runs, it writes several kinds of diagnostic information to the file, mc_parser.all. Please use google to find out what it all means. However, it does provide the raw data needed to think through most problems. However, if you make many changes at once, that process may be extremely painful.
Please address Makefile questions in this topic. Note that you can add new source files (.cpp and .h) to the directory without modifying the Makefile. They will be picked up automatically and dependencies will be created for them automatically. Note that this Makefile is meant only to build a single program from all the source in the directory -- so don't try to add a second program or a library to it -- unless you want to take on the challenge of keepign the automatic behaviors working correctly....
Understanding problems in a bison grammar can be challenging. The best advice I can give is to move slowly. That is, do not type in a bunch of grammar changes then expect to debug what is wrong with them. Instead, plan out the changes, then enter them into the grammar file one at a time, fully test all the language fragments your change is supposed to address. Run all your tests. Save the state the whole directory using "make backup", then add the next grammar fragment.
Althought I didn't create the basic mechanism for this solution, I can answer some questions about how to do things and would be happy to, given time limitations, in the forum. Google provides a lot of good examples on how to do things with flex and bison. Unfortunately, you may have to read more than the first search result to find what you are looking for. Good luck.
visual studio 2017 compile error in scriptLineStream.cxx
I made some code changes that seem to have fixed this but am not yet closing it. Those changes have been released prior to this date.
cursor droppings on windows 10.
no longer duplicatable after windows 10 updates
Though I have made no code changes to fix this, I can no longer duplicate the problem. Perhaps recent windows 10 updates made the problem go away. If the problem is still happening to you, please let me know.
They've made the windows 10 console act more like xterm -- which is good -- but it apparently invalidates some assumptions about the kinds of size changes that are allowed -- and thus effected the code in my console reader -- perhaps that explains the extraneous cursors I am seeing mostly on windows 10. See this page: https://blogs.windows.com/buildingapps/2014/10/07/console-improvements-in-the-windows-10-technical-preview/
On a regular basis, I am seeing (on windows 10), extraneous block cursors left cluttering up the screen. I don't seem to be able to figure out a robustly repeatable sequence of events that leads to the glowing white blocks being left on the screen by mistake. They go away when you use the cls command found in the .brashrc file -- but I need to be able to consistently repeat a sequence of commands that will reproduce the error on demand. Debugging this kind of problem is particularly tedious -- the...
basiscally, despite my chagrin, the case statement handler in brashCommands.cxx, had never properly handled case statements where the selector had backslashes in it. None of my tests did the most obvious pathname names.! BAD PROGRAMMER! BAD BOY!
case statements not properly handling backslash in pathnames
the change is made to lib\file.c. Calls to fnmatch() that were previously only taking FNM_PATHNAME, now take a macro that includes FNM_PATHNAME | FNM_INSENSITIVE | FNM_NOESCAPE.
fixing a problem with case statements when filename patterns must have backslashes in them.
case statements not properly handling backslash in pathnames
While it is temping to set an environment variable in your .brashrc script like this: export HOME=$(USERPROFILE) Some unix - like tools pulled off the net detect the existence of "HOME" as a flag that you are running on linux/unix and behave wrongly for windows. This may not happen to you, but if it does, it will be hard to figure what is going on. Brash defines BRASH_USER_HOME instead -- which are part of this set of predeclared variables: BRASH_DIR_SEPARATOR=\ BRASH_HOSTNAME=650RDLT031 BRASH_OS=MSWindows...
I have commtted changes to the repository as well as creating the 1.2.18 release files -- which incldue the windows binary in file bin/brash.exe. Note that that while there were bug fixes in 1.2.17, this release, 1.2.18, only provides an error message improvement to the .diff command.
updating comments prior to release.
improving the error messages from .diff when the input files are too long.
fixing bugs in the handling of pathnames containing ..\\..\\ and \\..
commit changes to fix the version number and binary executable for brash.exe version 1.2.17
including updated executables and comment files.
Brash has many built in functions, mostly they are direct simulations of the basic features available in the unix text processing commands. Use the command, builtins, to get a list of these commands and many of them have --help or -h options to get more details. Of particular interest are command line options that are added to the normal unix option set and which are designed to make it easier to write scripts: .ls The .ls command has a couple of helpful options not in the unix set: --seconds lets...
Brash has many built in functions, mostly they are direct simulations of the basic features available in the unix text processing commands. Use the command, builtins, to get a list of these commands and many of them have --help or -h options to get more details. Of particular interest are command line options that are added to the normal unix option set and which are designed to make it easier to write scripts: .ls The .ls command has a couple of helpful options not in the unix set: --seconds lets...
I posted an update to the above example which changed \" to ' in the calls to eval which runs the .regex function on files in subdirectories. This corrected a problem where the pathnames containing backslashes were being misinterpreted as escape sequences. Sigh.
Here is a example brash script that simulates grep using the following builtins: .ls .regex The script following script defines two functions: one which is used to print grep's help message, and the other that actually implements most of grep's main functionality 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82...
Threads Brash is a multithreaded program that uses a command handler thread pool. The size of that pool is set at the beginning of execution and it cannot change. The default size is 20 threads. Uses of threads There are 3 basic uses of threads in brash: 1. background jobs 2. pipe members 3. command line handling Command Line Handling When brash is reading from the console, every command you type in gets executed in a background thread. Thee command handler threads waits until completion of the secondary...
Threads Brash is a multithreaded program that uses a command handler thread pool. The size of that pool is set at the beginning of execution and it cannot change. The default size is 20 threads. Uses of threads There are 3 basic uses of threads in brash: 1. background jobs 2. pipe members 3. command line handling Command Line Handling When brash is reading from the console, every command you type in gets executed in a background thread. Thee command handler threads waits until completion of the secondary...
Threads Brash is a multithreaded program that uses a command handler thread pool. The size of that pool is set at the beginning of execution and it cannot change. The default size is 20 threads. Uses of threads There are 3 basic uses of threads in brash: 1. background jobs 2. pipe members 3. command line handling Command Line Handling When brash is reading from the console, every command you type in gets executed in a background thread. Thee command handler threads waits until completion of the secondary...
cursor droppings on windows 10.
Tab completion with \\ and .. can cause invalid text that may later crash
>> to a file named by a variable doesn't work
Here's how to change the backslashes in MS Windows style file names to forward slash: .ls -R | .regex -p '[\\]' -r '/' The -p and -r options to .regex go together -p sets the regex pattern to be replace in the input stream to .regex -r sets the replacement string I would have expected -p '\\' to have been sufficient, will investigate why the the [] characters are needed in this situation.
The find command in unix/linux is normally invoked like this: find . -name '*.c' | someOtherProgram In winbrash, you would write this instead: .ls -R | .regex -m '\.c$' | someOtherProgram Which works but then you have to remember to use a regular expression as the parameter to .regex instead of the more natural way of writing the file name pattern -- which is to use the standard "glob" characters: *.c .regex could be modified to have a -G globPattern option, but that violates the overall behavior...
I created a shortcut to brash and it runs fine, but when I control-C while sitting at the main command line prompt, my brash window closes. The solution is to make your windows short cut look like this: cmd /C brash.exe Of course, if brash.exe is not your path, you will need to specify the full pathname.
The fix for this problem is already available in version 1.2.16
I created a shortcut to brash and it runs fine, but when I control-C while sitting at the main command line prompt, my brash window closes. The solution is to make your windows short look like this: cmd /C brash.exe Of course, if brash.exe is not your path, you will need to specify the full pathname.
This release includes 2 bug fixes: it is now possible to use string expressions involving variables as file names in the redirection with append syntax: >>$varname works. The .wc command was failing to close its input file handle leading to a "cannot delete" situation until brash exited.
This release includes 2 bug fixes: it is now possible to use string expressions involving variables as file names in the redirection with append syntax: $varname works. The .wc command was failing to close its input file handle leading to a "cannot delete" situation until brash exited.
You can increase the number of running threads either from the command line or from inside a running script. See https://sourceforge.net/p/winbrash/discussion/examples/thread/bd3063c2/
Actually, the default number of threads was increased to 40.
fixed a bug that was reported by Scott Conway. The bug resulted in an error
Releasing version 1.2.16. Most of the changes are just minor bug fixes
cxx/brash/BrashRedirection.cxx has a function that is not correctly expanded the string expression that defines the file name. it is seeing ">>$varname" as a single string literal, not as an expression consisting of ">>" and "$varname". The parser is found in the cxx/scriptLanguage/include/cxxtls/stringexpressionparser.h. It needs to be modified so that the >>$var syntax is split into two expression nodes.
I'm seeing something a little different on my Windows 10 box. When I do this: file=fred echo stuff >>$file I see nothing in file file named fred, but I do see a file named '$file' which now contains stuff. The results may be different on Windows 7. I won't be able to test that for a while. This is of course a bug. Strangely, echo stuff >$file Does work. Hopefuly that should make it easier to narrow down.
feature under consideration.
feature request: elif construct
Looks like a bug. I'm looking into it.
>> to a file named by a variable doesn't work
adding missing documentation.
release 1.2.15
Brash has many built in functions, mostly they are direct simulations of the basic...
Here's an example of re-invoking brash.exe with different command line options from...
Here's an example of re-invoking brash.exe with different command line options from...
Here's an example of re-invoking brash.exe with different command line options from...
This release brings to a close the basic development cycle of winbrash. It includes...
rel-1.2.14 the & operator now populates variab...
Major bug fix to the behavior of background job...
This release fixes a bug in popd. It also fixes a major bug in the way that current...
Brash has many built in functions, mostly they are direct simulations of the basic...
By release 1.2.12, the .ls builtin command now has a couple of useful command line...
this feature was added in version 1.2.6. Only text copy/paste is supported. See .copypaste...
Changes to enable the -p option to .date, and t...
Release 1.2.10 -- fixes a bug in handling the r...
Adding support for colon, dot, and underscore i...
adding more help messages, .tail fixes for wind...
In brash.exe, Control-C is captured by the executable in the normal Window console...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
I re-uploaded version 1.2.7 and it is now showing up as the current release
Despite the clearly defined meaning of the .uniq command in unix, there many things...
Despite the clearly defined meaning of the .uniq command in unix, there many things...
Threads Brash is a multithreaded program that uses a command handler thread pool....
For some reason, release 1.2.7 is not showing up as the current release in source...
Problem is corrected in release 1.2.7.
Release 1.2.7 This release fixes a bug in release 1.2.6 wherein the .tail command...
rel-1.2.7 fixes a bug in the file sharing optio...
renamed new file to proper file name extension
looks like a difference between windows 7 and windows 10. Originally tested on Windows...
Problem under investigation...
Added .copypaste and .tail. Cleaned up the hel...
adding missing version
Updating the top level readme file
Despite the clearly defined meaning of the .uniq command in unix, there many things...
All, I had to re-release version 1.2.5. I'm not sure how this happened but the binaries...
removed a blank line
Releasing branch rel-1.2.5 -- which includes th...
With release 1.2.5, I am out of ideas for new commands. Bugs will continue to be...
Thsi release only adds the new command, .printf, which works mostly like the GNU...