首页 \ 问答 \ ANTLR“无法启动调试器。(ANTLR “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”)

ANTLR“无法启动调试器。(ANTLR “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”)

在AntlrWorks中运行的一个ANTLR语法引发了:“无法启动调试器。 超时等待连接到远程分析器。“

过去这条消息通常会消失,但这个消息是持久的。 在搜索ANTLR列表时(例如http://www.antlr.org/pipermail/antlr-interest/2009-June/034659.html ),有提示说错误信息与它看起来没什么关系,但可能是语法错误。

有没有人有关于如何“重新启动”或找到这种情况下的错误提示?


One of my ANTLR grammars running in AntlrWorks throws: “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”

In the past this message usually goes away but this one is persistent. On searching the ANTLR lists (e.g. http://www.antlr.org/pipermail/antlr-interest/2009-June/034659.html) there are hints that the error message is nothing to do with what it seems but could be a grammar error.

Has anyone got tips as to how to "reboot" or find the bugs in this situation?


原文:https://stackoverflow.com/questions/1845817
更新时间:2023-09-29 17:09

最满意答案

虽然我不确定这个解决方案是否真的是最好的,但它使我能够使用自定义模板,并通过在myappurls.py的url模式中明确填写kwargs中的工作流程来避免反向错误:

from django.contrib.auth import views as auth_views

url(r'^login/$', auth_views.login, {'template_name': 'myapp/registration/login.html'},name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': 'myapp:home'},name='logout'),

url(r'^password_reset/$', auth_views.password_reset,{'email_template_name':'myapp/registration/password_reset_email.html',
                                                    'template_name':'myapp/registration/password_reset_form.html',
                                                    'subject_template_name':'myapp/registration/password_reset_subject.txt',
                                                    'post_reset_redirect':'myapp:password_reset_done',
                                                    'from_email':'myapp@django.com',
                                                    },name='password_reset'),

url(r'^password_reset/done/$', auth_views.password_reset_done, {'template_name': 'myapp/registration/password_reset_done.html'}, name='password_reset_done'),

url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm,
                                                    {'template_name': 'myapp/registration/password_reset_confirm.html',
                                                    'post_reset_redirect': 'myapp:password_reset_complete'},
                                                    name='password_reset_confirm'),

url(r'^reset/done/$', auth_views.password_reset_complete, {'template_name': 'myapp/registration/password_reset_complete.html'},name='password_reset_complete'),

更新的答案!


尽管我在给出的第一个答案中找到了解决问题的方法,但我终于明白了真正的问题所在。

问题在于我的项目urls.py和myapp / urls.py之间的命名空间没有正确配置。 为了正确地排列所有内容,我需要将项目urls.py更改为指向app / urls.py并为其命名空间名称:

url(r'^',include('myapp.urls'),name ='myapp)

然后在app / urls.py中,我需要为rever方法分配一个命名空间名称来连接这两个:

app_name ='myapp'

urlpatterns = [ url(r'password_reset / done /',auth_views.password_reset_done,name ='password_reset_done'), url(r'password_reset /',auth_views.password_reset,name ='password_reset'), ]

现在一切都完美无缺,因为它应该没有桶装载的hacky参数。


Though I'm not sure if this solution really is the best, it's enabled me to use custom templates and avoid the reverse errors by explicitly filling out the workflow in kwargs in the urls patterns of the myappurls.py:

from django.contrib.auth import views as auth_views

url(r'^login/$', auth_views.login, {'template_name': 'myapp/registration/login.html'},name='login'),
url(r'^logout/$', auth_views.logout, {'next_page': 'myapp:home'},name='logout'),

url(r'^password_reset/$', auth_views.password_reset,{'email_template_name':'myapp/registration/password_reset_email.html',
                                                    'template_name':'myapp/registration/password_reset_form.html',
                                                    'subject_template_name':'myapp/registration/password_reset_subject.txt',
                                                    'post_reset_redirect':'myapp:password_reset_done',
                                                    'from_email':'myapp@django.com',
                                                    },name='password_reset'),

url(r'^password_reset/done/$', auth_views.password_reset_done, {'template_name': 'myapp/registration/password_reset_done.html'}, name='password_reset_done'),

url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm,
                                                    {'template_name': 'myapp/registration/password_reset_confirm.html',
                                                    'post_reset_redirect': 'myapp:password_reset_complete'},
                                                    name='password_reset_confirm'),

url(r'^reset/done/$', auth_views.password_reset_complete, {'template_name': 'myapp/registration/password_reset_complete.html'},name='password_reset_complete'),

UPDATED ANSWER!


Though I found a workaround to my problem in the first answer I gave, I finally understood what the real problem was.

The problem was that the namespaces were not correctly configured between my project urls.py and my myapp/urls.py. To correctly line everything up I needed to change the project urls.py to point to the app/urls.py and give it a namespace name:

url(r'^',include('myapp.urls'), name='myapp)

Then in the app/urls.py I needed to assign it a namespace name for the rever method to connect the two:

app_name = 'myapp'

urlpatterns = [ url(r'password_reset/done/', auth_views.password_reset_done,name='password_reset_done'), url(r'password_reset/', auth_views.password_reset, name='password_reset'), ]

Now everything works perfectly out of the box as it should without a bucket-load of hacky parameters.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)