Programming :: Implement Left-associative Operators In Parser That Does Not Allow Left Recursion?
Jan 20, 2011
The first is about implementing function calls. The way I currently have it is that functions are called with a C++ std::vector of nodes as the parameters. How would I turn a comma-seperated list of expressions into a C++ vector in the grammar?Second, how do you implement left-associative operators in a parser that does not allow left recursion?
And third, what would be the best internal representation of integers? A C++ int seems simplest, but limited. Using GMP seems more versatile, but I'm afraid it might seriously slow down the interpreter compared to C++ ints.
I'm still a but confused about the standard way of removing it for left-associative operators: [URL] Especially about how to construct an AST from it by executing a peice of code for every nonterminal matched. And I'm still not totally convinced that it will be left-associative, I just barely understand it. Also, how would you remove left-recursion for something like this:
Code: expr ::= expr "(" param_list ")" | other stuff...?
I would like to use two monitors with my desktop, so connected them the other day and it worked straight away, which is good but... The monitor configuration app always want the primary monitor to be on the left hand side, thus it always extend my desktop right. Can I do anything to extend my desktop to the left instead of to the right so I can have background application on the screen to the left?
I'm not sure if I should post this question in "hardware & laptops", or "Desktop Environments", because this is a hardware problem on a desktop computer.
Description of Problem:There is another thread that discussed this same problem that I'm having: However that thread is so old that the suggestions in it no longer work in Ubuntu 10.04 and for whatever reason I can not make a reply to that thread.As in the above thread, I've tried other input devices and rebooting the computer and using other USB ports, and my mouse still intermittently double left clicks randomly at times when I've only clicked the left mouse button once and at times and places when it should only produce a single click such as when selecting a drop down menu.
Has any one else had this problem, and does any one have any idea how to fix it or to trouble shoot this a bit more? Please let me know if there is any other information I can provide to further clarify or troubleshoot this issue.
When I swap my left alt with my left win key using the gnome keyboard layout options, the swap only works intermittently. I have an aluminum Apple keyboard with no numpad. No matter what layout options I choose, I can't seem to get it working.I also have the same setup on my laptop and work desktop and it works without issue. I've ensured my .Xmodmap doesn't exist.When I say "works intermittently" I mean when I'm trying to use "alt+b, alt+f" navigation in emacs or bash, it doesn't work but if I click around a bit then try again, it works. Also, I use alt+arrows to switch workspaces and that always works
can i get the ocuurance of left click-right click-double click?i need the time of ocurance and the click(left-right-double) that happend.any software?any clue..i need it in linux environment(kde or gnome)
it's been a long time since I did coding in C, but thought to pick up a very old project again, just to show off what I have been working on ten years ago.I deducted my problem as follows:
while writing script to send popup to another user i exposed to little window that appear at the left upper corner.i don't remember which command do it
I'm new to Linux and these forums, but programmed in C++ on other systems. I discovered several Linux terminal emulators don't render Right to Left languages properly and so as an exercise I writing my own. It based on GtkTextView widget. Basically is working, but the shell won't issue prompts because it doesn't think my terminal emulator is actually a terminal (isatty returns false)
I'm creating a bash script to check how much free space is left in /var directory then, if it hits a certain threshold, delete certain files with numbers for extensions (e.g. fileA.1, fileA.2 fileA.3, and fileA.4, fileB.1, fileB.2 fileB.3, and fileB.4 ). Here's a snippet from my script:
[Code]...
If I use a * as a wildcard for the number extension, the script fails. Maybe regex would work here, but I'm not particularly accomplished at it. Or some other construct.
I have a set of files to copy and decompress, and want to do these operations concurrently with a script.
Manually it would be something like:
Code:
The single & is intended to background the processes, while the && is intended to execute the gzip process if and only if the cp completes successfully.
My script is:
Code:
When I run it, bash gets angry with the following error:
So if you are a PHP-programmer (average one) and code for money, how many of funtions and operators of PHP should you remember by heart (in real life)? I was looking through php.net and man there are millions of tons of them!
I decided to try making a programming language again after my last unsuccessful attempt, so now I figured how to write a good AST and it works great when the nodes are hard-coded into a test program. But to make a language out of it, I need a parser to build the tree according to an input file. I ran into a problem here:
%token SEMICOLON INTEGER VARIABLE IF WHILE DO OPAREN CPAREN OBRACE CBRACE %right ASSIGN %left NE %left PLUS MINUS %left TIMES DIVIDE %% .....
As you might see, each nonterminal creates a Node* object and uses it as its value. The problem is that the literal tokens, however, don't return Node*'s and I don't know what to do. I would like to be able to convert literal tokens to nodes in the Lex file (which would avoid the problem), but the problem is with the assignment operator, which takes a Node* for the right-hand side and a variable name (not a Variable Node, because they just evaluate the the variable's value and you can't change the variable with them) for the left hand side.
What I am after is to get the string text from the clip tags. But for now I just tested to see if it can finds the command tags and print something if it does. But it doesn't find it. Anyone knows why ?
Looks like the xml is not good, i test it with a xml validator:
I am running 10.04 inside VirtualBox on a Mac. All is going great, but at some point my menu's moved to the top right instead of the top left. I have tried uninstalling/reinstalling the Guest Additions, logging off, and rebooting, all with no luck. There is a screenshot at Screenshot.jpg
In Ubuntu 11.04, how do I hide the left bar and top bar? I have a full screen opengl application that starts after the OS loads to the desktop.Unfortunately,the application bars are drawn on top of it.If they cannot be hidden on bootup, then just disabling them entirely would be acceptable.
Since F12 I've big troubles with my left shift key.
I've Fedora running on 3 hosts. 2 desktops and 1 laptop. Only on one of the desktops I've these troubles.
If I press the left shift key sometimes shift gets locked. If it's locked, no key can unlock it. Not the left, not the right shift, nor any other key... and I tried them all meanwhile;-)
It's a real shift lock, not a caps lock. After a (random?) time it releases itself without any user interaction. Releasetime varies between 1 and many seconds.
So, only waiting helps. I already followed the wiki entries for debugging keyboard (input-dev) issues. Watching the output of evtest shows exactly the same output for the usual case and the lock case. They both look like this... code...
I want to change the default behavior of my display hotkey combo (Fn+F7). I can do this in KDE, but in Gnome, the gnome-settings-daemon cycles through the options. Problem is, the option I want is not there. I want the laptop display on the right and the external display on the left. I know how to use xrandr to change this or to use System > Preferences > Display, but I want to use my hotkey combo. I see two ways to do this. Find the configuration file that selects the options that are cycled and manually edit it, or disable this hotkey combo for the gnome-settings-daemon and use my own script in /etc/acpi/actions, etc/acpi/events for the hotkey combo. Currently the gnome-settings-daemon intercepts the hotkey combo, so I can't use my own script. Anyone know anything about this, or do I need to file a bug report?
I have an WD 1TB external hard disk. When I try to write any file to it - even a 1kb text file - I get the message "no space left on device". I cannot write to the disk at all anymore - not files, not directories.The drive is formatted as an NTFS drive. I use F13. I can read from the drive without any apparent problem. Would anyone know what's causing this problem?
I've noticed this weird behavior where kTorrent would just stall downloading stuff if left on its own for a few hours. Once you activate kTorrent window from the panel it just gets on with the job, changing status from "stalled" to "downloading" in a few seconds.
Could it have something to do with the external disk I'm downloading on (some of the downloads, not all) being physically different one and connected via usb but mounted in a home directory?
I suspect this because Windows machine connected via samba also loses connection after a while as if there's some "time expiration" set on mounting drives into home.
I'm a recent migrant to Ubuntu from windows xp, and I definitely love linux. but, after years of windoze, I'm left with a few questions. today I tried installed kde, but it didn't work on my hardware, so I uninstalled it. i also tried to put google earth on my system, but it kept crashing so I removed it. after removing kde I had to reinstall a couple programs. all said, after doing all that, do I need to scan my system to remove trash files, or is that not a problem in linux?I'm also having some problems finding software after I've installed it in synaptic. when the package shows to be installed, I can't find any way to launch it through the menus. I don't have that problem if I use the ubuntu software center.
i am using avant for some days. it is great and works very well. but it always appears on the bottom. i want to make it appear on the left/right side of the screen. is it possible?
Everything was fine until I upgraded to the Beta 2, now the sound only comes out of my left headphone speaker and stereo speaker. My sound settings are the same and I have double checked them.Anyone else having this issue? Anyone know how to fix it?
I've been working on this for a couple days, but I cannot seem to find a solution either on my own or through trusty Google. For whatever reason, I cannot get the Super key assigned to the Left Win as I have had it in the past. There does not seem to be an option to do that in the Keyboard layout thingy.
defult theme however the close, maximize and minimize buttons are on the left of the screen instead of the right. Is there a way to move thoes back to the right side of the screen?