compiler-construction

how can I check if an object exists in C++

柔情痞子 提交于 2021-02-07 05:09:52
问题 I am trying to write a function that will check if an object exists: bool UnloadingBay::isEmpty() { bool isEmpty = true; if(this->unloadingShip != NULL) { isEmpty = false; } return isEmpty; } I am pretty new to C++ and not sure if my Java background is confusing something, but the compiler gives an error: UnloadingBay.cpp:36: error: no match for ‘operator!=’ in ‘((UnloadingBay*)this)->UnloadingBay::unloadingShip != 0’ I can't seem to figure out why it doesn't work. Here is the declaration for

how can I check if an object exists in C++

筅森魡賤 提交于 2021-02-07 05:09:29
问题 I am trying to write a function that will check if an object exists: bool UnloadingBay::isEmpty() { bool isEmpty = true; if(this->unloadingShip != NULL) { isEmpty = false; } return isEmpty; } I am pretty new to C++ and not sure if my Java background is confusing something, but the compiler gives an error: UnloadingBay.cpp:36: error: no match for ‘operator!=’ in ‘((UnloadingBay*)this)->UnloadingBay::unloadingShip != 0’ I can't seem to figure out why it doesn't work. Here is the declaration for

how can I check if an object exists in C++

不羁的心 提交于 2021-02-07 05:08:19
问题 I am trying to write a function that will check if an object exists: bool UnloadingBay::isEmpty() { bool isEmpty = true; if(this->unloadingShip != NULL) { isEmpty = false; } return isEmpty; } I am pretty new to C++ and not sure if my Java background is confusing something, but the compiler gives an error: UnloadingBay.cpp:36: error: no match for ‘operator!=’ in ‘((UnloadingBay*)this)->UnloadingBay::unloadingShip != 0’ I can't seem to figure out why it doesn't work. Here is the declaration for

How can I write a JavaScript compiler for Arduino or similar microcontroller? [closed]

烂漫一生 提交于 2021-02-07 03:57:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . Improve this question I realize that this question will raise some eyebrows, and I realize that JavaScript is traditionally an interpreted language, please let me explain: I am software engineer specializing in web applications (.NET stack specifically). As a hobby, I enjoy

How do I work with the AST in Irony now?

北城余情 提交于 2021-02-07 02:41:33
问题 I have a grammar that works and parses in the Irony console just fine, but I don't get anything in the AST treeview. I was following along with the BASIC->Javascript article found here: http://www.codeproject.com/Articles/25069/JSBasic-A-BASIC-to-JavaScript-Compiler, but it seems that the Ast stuff has all been moved/removed. I found the Irony.Interpreter .dll, which has some Ast stuff in it, but it seems all tied up in the Expression sample implementation. What am I missing here? I want to

Command Line Compiling a Win Forms C# Application

霸气de小男生 提交于 2021-02-06 13:58:11
问题 I'm trying to create a script to compile an Windows Forms C# 2.0 project from the command line (I know, I know.. I'm reinventing the wheel.. again.. but if somebody knows the answer, I'd appreciate it). The project is a standard Windows Forms project that has some resources and references a couple external assemblies. Here is a list of the files: Program.cs // no need to expand on this on :) frmMain.cs // this is a typical C# windows forms file frmMain.designer.cs // .. and the designer code

Command Line Compiling a Win Forms C# Application

筅森魡賤 提交于 2021-02-06 13:57:50
问题 I'm trying to create a script to compile an Windows Forms C# 2.0 project from the command line (I know, I know.. I'm reinventing the wheel.. again.. but if somebody knows the answer, I'd appreciate it). The project is a standard Windows Forms project that has some resources and references a couple external assemblies. Here is a list of the files: Program.cs // no need to expand on this on :) frmMain.cs // this is a typical C# windows forms file frmMain.designer.cs // .. and the designer code

checking whether the C compiler works… no

爷,独闯天下 提交于 2021-02-05 20:29:25
问题 I recently uninstalled Xcode 4.2 and re-installed Xcode 4.3.1. Installed Command Line Tools also. The error says 'C compiler doesn't work`. On searching for this error, it said that it happens when Xcode is not installed. What am I missing? rvm install 1.9.3 --with-gcc=clang Installing Ruby from source to: /Users/ava/.rvm/rubies/ruby-1.9.3-preview1, this may take a while depending on your cpu(s)... ruby-1.9.3-preview1 - #fetching ruby-1.9.3-preview1 - #extracting ruby-1.9.3-preview1 to /Users

checking whether the C compiler works… no

馋奶兔 提交于 2021-02-05 20:27:54
问题 I recently uninstalled Xcode 4.2 and re-installed Xcode 4.3.1. Installed Command Line Tools also. The error says 'C compiler doesn't work`. On searching for this error, it said that it happens when Xcode is not installed. What am I missing? rvm install 1.9.3 --with-gcc=clang Installing Ruby from source to: /Users/ava/.rvm/rubies/ruby-1.9.3-preview1, this may take a while depending on your cpu(s)... ruby-1.9.3-preview1 - #fetching ruby-1.9.3-preview1 - #extracting ruby-1.9.3-preview1 to /Users

Scanner NoSuchElementException

天涯浪子 提交于 2021-02-05 11:15:06
问题 I made a program that asks for 3 integers to output type of triangle. Everything runs and compiled successfully, however, it seems the part where it asks the user to see if they want to loop it again, the online compiler outputs the error: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:838) at java.util.Scanner.next(Scanner.java:1347) at Assignment5.main(Assignment5.java:56) import java.util.Scanner; public class Assignment5 { public